From e038b068b824e7d87f7fd845d2ac87cee3810416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Thu, 30 Jun 2011 20:31:07 -0400 Subject: [PATCH] cmake: initial commit --- .gitignore | 15 ++ CMakeLists.txt | 28 ++++ include/CMakeLists.txt | 4 + include/freerdp/kbd.h | 44 ++++++ include/freerdp/types/base.h | 47 ++++++ libfreerdp-asn1/CMakeLists.txt | 264 ++++++++++++++++++++++++++++++++ libfreerdp-kbd/CMakeLists.txt | 26 ++++ libfreerdp-utils/CMakeLists.txt | 18 +++ 8 files changed, 446 insertions(+) create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 include/CMakeLists.txt create mode 100644 include/freerdp/kbd.h create mode 100644 include/freerdp/types/base.h create mode 100644 libfreerdp-asn1/CMakeLists.txt create mode 100644 libfreerdp-kbd/CMakeLists.txt create mode 100644 libfreerdp-utils/CMakeLists.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..16d93b19d --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +# CMake +*.cmake +CMakeFiles/ +CMakeCache.txt + +# Make +Makefile + +# Eclipse +*.project +*.cproject + +# Binaries +*.so +*.so.* diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..b42de4b9f --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required(VERSION 2.8) +project(FreeRDP C) +set(CMAKE_COLOR_MAKEFILE ON) + +# Include our extra modules +set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/) + +# Soname versioning - 0.0.0 since it is not being managed yet +set(FREERDP_VERSION_MAJOR "0") +set(FREERDP_VERSION_MINOR "0") +set(FREERDP_VERSION_PATCH "0") +set(FREERDP_VERSION "${FREERDP_VERSION_MAJOR}.${FREERDP_VERSION_MINOR}") +set(FREERDP_VERSION_FULL "${FREERDP_VERSION}.${FREERDP_VERSION_PATCH}") + +# Default to release build type +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Release") +endif() + +# Path to put keymaps +set(FREERDP_KEYMAP_PATH "${CMAKE_INSTALL_PREFIX}/freerdp/keymaps") + +# Libraries +add_subdirectory(include) +add_subdirectory(libfreerdp-asn1) +add_subdirectory(libfreerdp-utils) +add_subdirectory(libfreerdp-kbd) + diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt new file mode 100644 index 000000000..09e9c931c --- /dev/null +++ b/include/CMakeLists.txt @@ -0,0 +1,4 @@ +# include + +file(GLOB HEADERS "freerdp/*.h") +install_files(/include/oshwcollect FILES ${HEADERS}) diff --git a/include/freerdp/kbd.h b/include/freerdp/kbd.h new file mode 100644 index 000000000..aad392d51 --- /dev/null +++ b/include/freerdp/kbd.h @@ -0,0 +1,44 @@ +/** + * FreeRDP: A Remote Desktop Protocol Client + * XKB-based keyboard mapping + * + * Copyright 2009 Marc-Andre Moreau + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __FREERDP_KBD_H +#define __FREERDP_KBD_H + +#include "types/base.h" + +#define RDP_KEYBOARD_LAYOUT_TYPE_STANDARD 1 +#define RDP_KEYBOARD_LAYOUT_TYPE_VARIANT 2 +#define RDP_KEYBOARD_LAYOUT_TYPE_IME 4 + +typedef struct rdp_keyboard_layout +{ + uint32 code; + char name[50]; +} rdpKeyboardLayout; + +rdpKeyboardLayout * +freerdp_kbd_get_layouts(int types); +unsigned int +freerdp_kbd_init(void *dpy, unsigned int keyboard_layout_id); +uint8 +freerdp_kbd_get_scancode_by_keycode(uint8 keycode, fbool * extended); +uint8 +freerdp_kbd_get_scancode_by_virtualkey(int vkcode, fbool * extended); + +#endif /* __FREERDP_KBD_H */ diff --git a/include/freerdp/types/base.h b/include/freerdp/types/base.h new file mode 100644 index 000000000..4a8af6ab5 --- /dev/null +++ b/include/freerdp/types/base.h @@ -0,0 +1,47 @@ +/** + * FreeRDP: A Remote Desktop Protocol Client + * Base Types + * + * Copyright 2009-2011 Jay Sorg + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __TYPES_BASE_H +#define __TYPES_BASE_H + +typedef unsigned char uint8; +typedef signed char sint8; +typedef unsigned short uint16; +typedef signed short sint16; +typedef unsigned int uint32; +typedef signed int sint32; +#ifdef _WIN32 +typedef unsigned __int64 uint64; +typedef signed __int64 sint64; +#else +typedef unsigned long long uint64; +typedef signed long long sint64; +#endif + +#ifndef True +#define True (1) +#endif + +#ifndef False +#define False (0) +#endif + +typedef int fbool; + +#endif diff --git a/libfreerdp-asn1/CMakeLists.txt b/libfreerdp-asn1/CMakeLists.txt new file mode 100644 index 000000000..3a7a3b726 --- /dev/null +++ b/libfreerdp-asn1/CMakeLists.txt @@ -0,0 +1,264 @@ +# libfreerdp-asn1 + +include_directories(.) + +set(COMMON_SRCS + asn_application.h + asn_codecs.h + asn_codecs_prim.c + asn_codecs_prim.h + asn_internal.h + asn_SEQUENCE_OF.c + asn_SEQUENCE_OF.h + asn_SET_OF.c + asn_SET_OF.h + asn_system.h + ber_decoder.c + ber_decoder.h + ber_tlv_length.c + ber_tlv_length.h + ber_tlv_tag.c + ber_tlv_tag.h + BIT_STRING.c + BIT_STRING.h + constraints.c + constraints.h + constr_CHOICE.c + constr_CHOICE.h + constr_SEQUENCE.c + constr_SEQUENCE.h + constr_SEQUENCE_OF.c + constr_SEQUENCE_OF.h + constr_SET_OF.c + constr_SET_OF.h + constr_TYPE.c + constr_TYPE.h + der_encoder.c + der_encoder.h + GeneralString.c + GeneralString.h + INTEGER.c + INTEGER.h + NativeEnumerated.c + NativeEnumerated.h + NativeInteger.c + NativeInteger.h + OBJECT_IDENTIFIER.c + OBJECT_IDENTIFIER.h + OCTET_STRING.c + OCTET_STRING.h + per_decoder.c + per_decoder.h + per_encoder.c + per_encoder.h + per_opentype.c + per_opentype.h + per_support.c + per_support.h + xer_decoder.c + xer_decoder.h + xer_encoder.c + xer_encoder.h + xer_support.c + xer_support.h) + +set(CREDSSP_SRCS + NegoData.c + NegoData.h + NegoDataItem.c + NegoDataItem.h + TSCredentials.c + TSCredentials.h + TSCspDataDetail.c + TSCspDataDetail.h + TSPasswordCreds.c + TSPasswordCreds.h + TSRequest.c + TSRequest.h + TSSmartCardCreds.c + TSSmartCardCreds.h) + +set(SPNEGO_SRCS + ContextFlags.c + ContextFlags.h + MechType.c + MechType.h + MechTypeList.c + MechTypeList.h + NegHints.c + NegHints.h + NegotiationToken.c + NegotiationToken.h + NegTokenInit2.c + NegTokenInit2.h + NegTokenInit.c + NegTokenInit.h + NegTokenResp.c + NegTokenResp.h) + +set(MCS_SRCS + AssignedChannelId.c + AssignedChannelId.h + AttachUserConfirm.c + AttachUserConfirm.h + AttachUserRequest.c + AttachUserRequest.h + BOOLEAN.c + BOOLEAN.h + CapabilitiesNotificationIndication.c + CapabilitiesNotificationIndication.h + CapabilitiesNotificationRequest.c + CapabilitiesNotificationRequest.h + CapabilityClass.c + CapabilityClass.h + CapabilityID.c + CapabilityID.h + ChannelAdmitIndication.c + ChannelAdmitIndication.h + ChannelAdmitRequest.c + ChannelAdmitRequest.h + ChannelAttributes.c + ChannelAttributes.h + ChannelConveneConfirm.c + ChannelConveneConfirm.h + ChannelConveneRequest.c + ChannelConveneRequest.h + ChannelDisbandIndication.c + ChannelDisbandIndication.h + ChannelDisbandRequest.c + ChannelDisbandRequest.h + ChannelExpelIndication.c + ChannelExpelIndication.h + ChannelExpelRequest.c + ChannelExpelRequest.h + ChannelId.c + ChannelId.h + ChannelJoinConfirm.c + ChannelJoinConfirm.h + ChannelJoinRequest.c + ChannelJoinRequest.h + ChannelLeaveRequest.c + ChannelLeaveRequest.h + DataPriority.c + DataPriority.h + DetachUserIndication.c + DetachUserIndication.h + DetachUserRequest.c + DetachUserRequest.h + Diagnostic.c + Diagnostic.h + DisconnectProviderUltimatum.c + DisconnectProviderUltimatum.h + DomainMCSPDU.c + DomainMCSPDU.h + DynamicChannelId.c + DynamicChannelId.h + ErectDomainRequest.c + ErectDomainRequest.h + ExtendedParameterAccept.c + ExtendedParameterAccept.h + ExtendedParameterMCSPDU.c + ExtendedParameterMCSPDU.h + ExtendedParameterPropose.c + ExtendedParameterPropose.h + ExtendedParameters.c + ExtendedParameters.h + H221NonStandardIdentifier.c + H221NonStandardIdentifier.h + IndicationCapability.c + IndicationCapability.h + Key.c + Key.h + MergeChannelsConfirm.c + MergeChannelsConfirm.h + MergeChannelsRequest.c + MergeChannelsRequest.h + MergeTokensConfirm.c + MergeTokensConfirm.h + MergeTokensRequest.c + MergeTokensRequest.h + NonStandardParameter.c + NonStandardParameter.h + NonStandardPDU.c + NonStandardPDU.h + NULL.c + NULL.h + ParticipationIndicator.c + ParticipationIndicator.h + PlumbDomainIndication.c + PlumbDomainIndication.h + PrivateChannelId.c + PrivateChannelId.h + PurgeChannelsIndication.c + PurgeChannelsIndication.h + PurgeTokensIndication.c + PurgeTokensIndication.h + Reason.c + Reason.h + RejectMCSPDUUltimatum.c + RejectMCSPDUUltimatum.h + RequestCapability.c + RequestCapability.h + Result.c + Result.h + Segmentation.c + Segmentation.h + SendDataIndication.c + SendDataIndication.h + SendDataRequest.c + SendDataRequest.h + SeqOfIndicationCapabilities.c + SeqOfIndicationCapabilities.h + SeqOfRequestCapabilities.c + SeqOfRequestCapabilities.h + StaticChannelId.c + StaticChannelId.h + TokenAttributes.c + TokenAttributes.h + TokenGiveConfirm.c + TokenGiveConfirm.h + TokenGiveIndication.c + TokenGiveIndication.h + TokenGiveRequest.c + TokenGiveRequest.h + TokenGiveResponse.c + TokenGiveResponse.h + TokenGrabConfirm.c + TokenGrabConfirm.h + TokenGrabRequest.c + TokenGrabRequest.h + TokenId.c + TokenId.h + TokenInhibitConfirm.c + TokenInhibitConfirm.h + TokenInhibitRequest.c + TokenInhibitRequest.h + TokenPleaseIndication.c + TokenPleaseIndication.h + TokenPleaseRequest.c + TokenPleaseRequest.h + TokenReleaseConfirm.c + TokenReleaseConfirm.h + TokenReleaseRequest.c + TokenReleaseRequest.h + TokenStatus.c + TokenStatus.h + TokenTestConfirm.c + TokenTestConfirm.h + TokenTestRequest.c + TokenTestRequest.h + UniformSendDataIndication.c + UniformSendDataIndication.h + UniformSendDataRequest.c + UniformSendDataRequest.h + UserId.c + UserId.h) + +# disable warnings +if(CMAKE_COMPILER_IS_GNUCC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") +endif() + +# MCS_SRCS not in use +add_library(freerdp-asn1 SHARED ${COMMON_SRCS} ${CREDSSP_SRCS} ${SPNEGO_SRCS}) + diff --git a/libfreerdp-kbd/CMakeLists.txt b/libfreerdp-kbd/CMakeLists.txt new file mode 100644 index 000000000..02823ecbb --- /dev/null +++ b/libfreerdp-kbd/CMakeLists.txt @@ -0,0 +1,26 @@ +# libfreerdp-kbd + +include_directories(.) +include_directories(../include) + +set(FREERDP_KBD_SRCS + keyboard.h + locales.c + locales.h + layout_ids.c + layout_ids.h + layouts_xkb.c + layouts_xkb.h + x_layout_id_table.c + x_layout_id_table.h + libkbd.c + libkbd.h) + +add_definitions(-DKEYMAP_PATH="${FREERDP_KEYMAP_PATH}") + +add_library(freerdp-kbd SHARED ${FREERDP_KBD_SRCS}) + +set_target_properties(freerdp-kbd PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION}) + +install(TARGETS freerdp-kbd DESTINATION lib) + diff --git a/libfreerdp-utils/CMakeLists.txt b/libfreerdp-utils/CMakeLists.txt new file mode 100644 index 000000000..c2669b06f --- /dev/null +++ b/libfreerdp-utils/CMakeLists.txt @@ -0,0 +1,18 @@ +# libfreerdp-utils + +include_directories(.) +include_directories(../include) + +set(FREERDP_UTILS_SRCS + datablob.c + hexdump.c + memory.c + semaphore.c + unicode.c) + +add_library(freerdp-utils SHARED ${FREERDP_UTILS_SRCS}) + +set_target_properties(freerdp-utils PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION}) + +install(TARGETS freerdp-utils DESTINATION lib) +