From e4e85be15db638e5202febe3c1a001b82bf546ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Sat, 22 Sep 2012 19:25:21 -0400 Subject: [PATCH] channels: add automatic inclusion and bundling of built-in server channels --- channels/CMakeLists.txt | 6 ++-- channels/audin/CMakeLists.txt | 10 ++++++ channels/audin/server/CMakeLists.txt | 29 +++++++++++++++ .../audin/server}/audin.c | 0 channels/rdpsnd/CMakeLists.txt | 10 ++++++ channels/rdpsnd/ChannelOptions.cmake | 2 ++ channels/rdpsnd/server/CMakeLists.txt | 29 +++++++++++++++ .../rdpsnd/server}/rdpsnd.c | 0 channels/server/CMakeLists.txt | 35 +++++++++++++++++++ channels/tsmf/CMakeLists.txt | 19 ++++++++++ channels/tsmf/client/tsmf_audio.h | 2 +- channels/tsmf/client/tsmf_codec.c | 1 - channels/tsmf/client/tsmf_decoder.c | 1 - channels/tsmf/client/tsmf_decoder.h | 1 - channels/tsmf/client/tsmf_ifman.c | 2 +- channels/tsmf/client/tsmf_main.c | 2 +- channels/tsmf/client/tsmf_media.c | 1 - channels/tsmf/client/tsmf_types.h | 12 +++++++ server/CMakeLists.txt | 2 -- server/channels/CMakeLists.txt | 34 ------------------ 20 files changed, 152 insertions(+), 46 deletions(-) create mode 100644 channels/audin/server/CMakeLists.txt rename {server/channels => channels/audin/server}/audin.c (100%) create mode 100644 channels/rdpsnd/server/CMakeLists.txt rename {server/channels => channels/rdpsnd/server}/rdpsnd.c (100%) create mode 100644 channels/server/CMakeLists.txt create mode 100644 channels/tsmf/CMakeLists.txt delete mode 100644 server/channels/CMakeLists.txt diff --git a/channels/CMakeLists.txt b/channels/CMakeLists.txt index c29f04e30..3ecbbd569 100644 --- a/channels/CMakeLists.txt +++ b/channels/CMakeLists.txt @@ -1,9 +1,7 @@ # FreeRDP: A Remote Desktop Protocol Client # FreeRDP cmake build script # -# Copyright 2011 O.S. Systems Software Ltda. -# Copyright 2011 Otavio Salvador -# Copyright 2011 Marc-Andre Moreau +# Copyright 2012 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. @@ -32,3 +30,5 @@ foreach(FILEPATH ${FILEPATHS}) endif() endforeach(FILEPATH) +add_subdirectory(server) + diff --git a/channels/audin/CMakeLists.txt b/channels/audin/CMakeLists.txt index e6e70054d..45849a4e0 100644 --- a/channels/audin/CMakeLists.txt +++ b/channels/audin/CMakeLists.txt @@ -15,5 +15,15 @@ # See the License for the specific language governing permissions and # limitations under the License. +set(MODULE_NAME "audin") +set(MODULE_PREFIX "CHANNEL_AUDIN") + add_subdirectory(client) +add_subdirectory(server) + +set(${MODULE_PREFIX}_SERVER_SRCS ${${MODULE_PREFIX}_SERVER_SRCS} PARENT_SCOPE) +set(${MODULE_PREFIX}_SERVER_LIBS ${${MODULE_PREFIX}_SERVER_LIBS} PARENT_SCOPE) +set(CHANNEL_BUILTIN_SERVER_MODULES ${CHANNEL_BUILTIN_SERVER_MODULES} ${MODULE_NAME} PARENT_SCOPE) + + diff --git a/channels/audin/server/CMakeLists.txt b/channels/audin/server/CMakeLists.txt new file mode 100644 index 000000000..3280cfd05 --- /dev/null +++ b/channels/audin/server/CMakeLists.txt @@ -0,0 +1,29 @@ +# FreeRDP: A Remote Desktop Protocol Client +# FreeRDP cmake build script +# +# Copyright 2012 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. + +set(MODULE_PREFIX "CHANNEL_AUDIN_SERVER") + +set(${MODULE_PREFIX}_SRCS + audin.c + PARENT_SCOPE) + +if(WITH_MONOLITHIC_BUILD) + set(${MODULE_PREFIX}_LIBS freerdp PARENT_SCOPE) +else() + set(${MODULE_PREFIX}_LIBS freerdp-utils PARENT_SCOPE) +endif() + diff --git a/server/channels/audin.c b/channels/audin/server/audin.c similarity index 100% rename from server/channels/audin.c rename to channels/audin/server/audin.c diff --git a/channels/rdpsnd/CMakeLists.txt b/channels/rdpsnd/CMakeLists.txt index e6e70054d..aad0c5af1 100644 --- a/channels/rdpsnd/CMakeLists.txt +++ b/channels/rdpsnd/CMakeLists.txt @@ -15,5 +15,15 @@ # See the License for the specific language governing permissions and # limitations under the License. +set(MODULE_NAME "rdpsnd") +set(MODULE_PREFIX "CHANNEL_RDPSND") + add_subdirectory(client) +add_subdirectory(server) + +set(${MODULE_PREFIX}_SERVER_SRCS ${${MODULE_PREFIX}_SERVER_SRCS} PARENT_SCOPE) +set(${MODULE_PREFIX}_SERVER_LIBS ${${MODULE_PREFIX}_SERVER_LIBS} PARENT_SCOPE) +set(CHANNEL_BUILTIN_SERVER_MODULES ${CHANNEL_BUILTIN_SERVER_MODULES} ${MODULE_NAME} PARENT_SCOPE) + + diff --git a/channels/rdpsnd/ChannelOptions.cmake b/channels/rdpsnd/ChannelOptions.cmake index fb8b2ef2a..1b307d2ee 100644 --- a/channels/rdpsnd/ChannelOptions.cmake +++ b/channels/rdpsnd/ChannelOptions.cmake @@ -4,6 +4,8 @@ set(CHANNEL_SHORT_NAME "rdpsnd") set(CHANNEL_LONG_NAME "Audio Output Virtual Channel Extension") set(CHANNEL_SPECIFICATIONS "[MS-RDPEA]") +string(TOUPPER "WITH_${CHANNEL_SHORT_NAME}" CHANNEL_OPTION) + if(WIN32) option(${CHANNEL_OPTION} "Build ${CHANNEL_SHORT_NAME}" OFF) else() diff --git a/channels/rdpsnd/server/CMakeLists.txt b/channels/rdpsnd/server/CMakeLists.txt new file mode 100644 index 000000000..2e680b46e --- /dev/null +++ b/channels/rdpsnd/server/CMakeLists.txt @@ -0,0 +1,29 @@ +# FreeRDP: A Remote Desktop Protocol Client +# FreeRDP cmake build script +# +# Copyright 2012 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. + +set(MODULE_PREFIX "CHANNEL_RDPSND_SERVER") + +set(${MODULE_PREFIX}_SRCS + rdpsnd.c + PARENT_SCOPE) + +if(WITH_MONOLITHIC_BUILD) + set(${MODULE_PREFIX}_LIBS freerdp PARENT_SCOPE) +else() + set(${MODULE_PREFIX}_LIBS freerdp-utils PARENT_SCOPE) +endif() + diff --git a/server/channels/rdpsnd.c b/channels/rdpsnd/server/rdpsnd.c similarity index 100% rename from server/channels/rdpsnd.c rename to channels/rdpsnd/server/rdpsnd.c diff --git a/channels/server/CMakeLists.txt b/channels/server/CMakeLists.txt new file mode 100644 index 000000000..5b7b8ba24 --- /dev/null +++ b/channels/server/CMakeLists.txt @@ -0,0 +1,35 @@ +# FreeRDP: A Remote Desktop Protocol Client +# FreeRDP cmake build script +# +# Copyright 2012 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. + +foreach(MODULE_NAME ${CHANNEL_BUILTIN_SERVER_MODULES}) + string(TOUPPER "CHANNEL_${MODULE_NAME}" MODULE_PREFIX) + message(STATUS "Adding built-in channel server module: ${MODULE_NAME}") + + foreach(SRC ${${MODULE_PREFIX}_SERVER_SRCS}) + set(CHANNEL_SERVER_SRCS ${CHANNEL_SERVER_SRCS} "../${MODULE_NAME}/server/${SRC}") + endforeach() + + set(CHANNEL_SERVER_LIBS ${CHANNEL_SERVER_LIBS} ${${MODULE_PREFIX}_SERVER_LIBS}) +endforeach() + +add_library(freerdp-server ${CHANNEL_SERVER_SRCS}) + +set_target_properties(freerdp-server PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib") + +target_link_libraries(freerdp-server ${CHANNEL_SERVER_LIBS}) +install(TARGETS freerdp-server DESTINATION ${CMAKE_INSTALL_LIBDIR}) + diff --git a/channels/tsmf/CMakeLists.txt b/channels/tsmf/CMakeLists.txt new file mode 100644 index 000000000..e6e70054d --- /dev/null +++ b/channels/tsmf/CMakeLists.txt @@ -0,0 +1,19 @@ +# FreeRDP: A Remote Desktop Protocol Client +# FreeRDP cmake build script +# +# Copyright 2012 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. + +add_subdirectory(client) + diff --git a/channels/tsmf/client/tsmf_audio.h b/channels/tsmf/client/tsmf_audio.h index 5492cb88a..1215460c5 100644 --- a/channels/tsmf/client/tsmf_audio.h +++ b/channels/tsmf/client/tsmf_audio.h @@ -20,7 +20,7 @@ #ifndef __TSMF_AUDIO_H #define __TSMF_AUDIO_H -#include "drdynvc_types.h" +#include "tsmf_types.h" typedef struct _ITSMFAudioDevice ITSMFAudioDevice; diff --git a/channels/tsmf/client/tsmf_codec.c b/channels/tsmf/client/tsmf_codec.c index 64296b1c3..ceb28bbcf 100644 --- a/channels/tsmf/client/tsmf_codec.c +++ b/channels/tsmf/client/tsmf_codec.c @@ -29,7 +29,6 @@ #include #include -#include "drdynvc_types.h" #include "tsmf_constants.h" #include "tsmf_types.h" diff --git a/channels/tsmf/client/tsmf_decoder.c b/channels/tsmf/client/tsmf_decoder.c index 5a604eb30..267a9f97e 100644 --- a/channels/tsmf/client/tsmf_decoder.c +++ b/channels/tsmf/client/tsmf_decoder.c @@ -28,7 +28,6 @@ #include #include -#include "drdynvc_types.h" #include "tsmf_types.h" #include "tsmf_constants.h" #include "tsmf_decoder.h" diff --git a/channels/tsmf/client/tsmf_decoder.h b/channels/tsmf/client/tsmf_decoder.h index dd911dbcf..91d3ee31f 100644 --- a/channels/tsmf/client/tsmf_decoder.h +++ b/channels/tsmf/client/tsmf_decoder.h @@ -21,7 +21,6 @@ #ifndef __TSMF_DECODER_H #define __TSMF_DECODER_H -#include "drdynvc_types.h" #include "tsmf_types.h" typedef enum _ITSMFControlMsg diff --git a/channels/tsmf/client/tsmf_ifman.c b/channels/tsmf/client/tsmf_ifman.c index 71a6d9bef..86f5101b3 100644 --- a/channels/tsmf/client/tsmf_ifman.c +++ b/channels/tsmf/client/tsmf_ifman.c @@ -29,7 +29,7 @@ #include #include -#include "drdynvc_types.h" +#include "tsmf_types.h" #include "tsmf_constants.h" #include "tsmf_media.h" #include "tsmf_codec.h" diff --git a/channels/tsmf/client/tsmf_main.c b/channels/tsmf/client/tsmf_main.c index 53a1dbdba..6c266cf51 100644 --- a/channels/tsmf/client/tsmf_main.c +++ b/channels/tsmf/client/tsmf_main.c @@ -28,7 +28,7 @@ #include #include -#include "drdynvc_types.h" +#include "tsmf_types.h" #include "tsmf_constants.h" #include "tsmf_ifman.h" #include "tsmf_media.h" diff --git a/channels/tsmf/client/tsmf_media.c b/channels/tsmf/client/tsmf_media.c index 098bdf515..58568b958 100644 --- a/channels/tsmf/client/tsmf_media.c +++ b/channels/tsmf/client/tsmf_media.c @@ -45,7 +45,6 @@ #include -#include "drdynvc_types.h" #include "tsmf_constants.h" #include "tsmf_types.h" #include "tsmf_decoder.h" diff --git a/channels/tsmf/client/tsmf_types.h b/channels/tsmf/client/tsmf_types.h index 20745cb92..65e8b2a18 100644 --- a/channels/tsmf/client/tsmf_types.h +++ b/channels/tsmf/client/tsmf_types.h @@ -20,7 +20,19 @@ #ifndef __TSMF_TYPES_H #define __TSMF_TYPES_H +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include #include +#include + +#ifdef WITH_DEBUG_DVC +#define DEBUG_DVC(fmt, ...) DEBUG_CLASS(DVC, fmt, ## __VA_ARGS__) +#else +#define DEBUG_DVC(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__) +#endif typedef struct _TS_AM_MEDIA_TYPE { diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index a42687eb0..6ac9ede9d 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -33,5 +33,3 @@ else() add_subdirectory(Windows) endif() -# Build Server Channels library -add_subdirectory(channels) diff --git a/server/channels/CMakeLists.txt b/server/channels/CMakeLists.txt deleted file mode 100644 index 2ee9473e5..000000000 --- a/server/channels/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -# FreeRDP: A Remote Desktop Protocol Client -# libfreerdp-server-channels cmake build script -# -# Copyright 2011 O.S. Systems Software Ltda. -# Copyright 2011 Otavio Salvador -# Copyright 2011 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. - -set(FREERDP_SERVER_CHANNELS_SRCS - audin.c - rdpsnd.c) - -add_library(freerdp-server-channels ${FREERDP_SERVER_CHANNELS_SRCS}) - -set_target_properties(freerdp-server-channels PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib") - -if(WITH_MONOLITHIC_BUILD) - target_link_libraries(freerdp-server-channels freerdp) -else() - target_link_libraries(freerdp-server-channels freerdp-channels freerdp-utils) -endif() - -install(TARGETS freerdp-server-channels DESTINATION ${CMAKE_INSTALL_LIBDIR})