diff --git a/channels/CMakeLists.txt b/channels/CMakeLists.txt index 1951fd8f1..06419e805 100644 --- a/channels/CMakeLists.txt +++ b/channels/CMakeLists.txt @@ -17,13 +17,18 @@ # See the License for the specific language governing permissions and # limitations under the License. -add_subdirectory(cliprdr) -add_subdirectory(drdynvc) -add_subdirectory(rail) -add_subdirectory(rdpdbg) -add_subdirectory(skel) +set(FILENAME "ChannelOptions.cmake") +file(GLOB FILEPATHS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*/${FILENAME}") + +foreach(FILEPATH ${FILEPATHS}) + if(${FILEPATH} MATCHES "^([^/]*)//${FILENAME}") + string(REGEX REPLACE "^([^/]*)//${FILENAME}" "\\1" DIR ${FILEPATH}) + set(CHANNEL_OPTION) + include(${FILEPATH}) + if(${CHANNEL_OPTION}) + message(STATUS "Adding ${CHANNEL_TYPE} channel \"${CHANNEL_SHORT_NAME}\": ${CHANNEL_LONG_NAME} (${CHANNEL_SPECIFICATIONS})") + add_subdirectory(${DIR}) + endif() + endif() +endforeach(FILEPATH) -if(NOT WIN32) - add_subdirectory(rdpdr) - add_subdirectory(rdpsnd) -endif() diff --git a/channels/cliprdr/ChannelOptions.cmake b/channels/cliprdr/ChannelOptions.cmake new file mode 100644 index 000000000..1cbbb619b --- /dev/null +++ b/channels/cliprdr/ChannelOptions.cmake @@ -0,0 +1,10 @@ + +set(CHANNEL_TYPE "static") +set(CHANNEL_SHORT_NAME "cliprdr") +set(CHANNEL_LONG_NAME "Clipboard Virtual Channel Extension") +set(CHANNEL_SPECIFICATIONS "[MS-RDPECLIP]") + +string(TOUPPER "WITH_${CHANNEL_SHORT_NAME}" CHANNEL_OPTION) +option(${CHANNEL_OPTION} "Build ${CHANNEL_SHORT_NAME}" ON) + + diff --git a/channels/drdynvc/ChannelOptions.cmake b/channels/drdynvc/ChannelOptions.cmake new file mode 100644 index 000000000..cf67ef513 --- /dev/null +++ b/channels/drdynvc/ChannelOptions.cmake @@ -0,0 +1,9 @@ + +set(CHANNEL_TYPE "static") +set(CHANNEL_SHORT_NAME "drdynvc") +set(CHANNEL_LONG_NAME "Dynamic Virtual Channel Extension") +set(CHANNEL_SPECIFICATIONS "[MS-RDPEDYC]") + +string(TOUPPER "WITH_${CHANNEL_SHORT_NAME}" CHANNEL_OPTION) +option(${CHANNEL_OPTION} "Build ${CHANNEL_SHORT_NAME}" ON) + diff --git a/channels/rail/ChannelOptions.cmake b/channels/rail/ChannelOptions.cmake new file mode 100644 index 000000000..786cbfc17 --- /dev/null +++ b/channels/rail/ChannelOptions.cmake @@ -0,0 +1,9 @@ + +set(CHANNEL_TYPE "static") +set(CHANNEL_SHORT_NAME "rail") +set(CHANNEL_LONG_NAME "Remote Programs Virtual Channel Extension") +set(CHANNEL_SPECIFICATIONS "[MS-RDPERP]") + +string(TOUPPER "WITH_${CHANNEL_SHORT_NAME}" CHANNEL_OPTION) +option(${CHANNEL_OPTION} "Build ${CHANNEL_SHORT_NAME}" ON) + diff --git a/channels/rdpdbg/CMakeLists.txt b/channels/rdpdbg/CMakeLists.txt deleted file mode 100644 index 7387269da..000000000 --- a/channels/rdpdbg/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -# 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 -# -# 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(RDPDBG_SRCS - rdpdbg_main.c -) - -add_library(rdpdbg ${RDPDBG_SRCS}) -set_target_properties(rdpdbg PROPERTIES PREFIX "") - -if(WITH_MONOLITHIC_BUILD) - target_link_libraries(rdpdbg freerdp) -else() - target_link_libraries(rdpdbg freerdp-utils) -endif() - -install(TARGETS rdpdbg DESTINATION ${FREERDP_PLUGIN_PATH}) diff --git a/channels/rdpdbg/rdpdbg_main.c b/channels/rdpdbg/rdpdbg_main.c deleted file mode 100644 index a1cdc212c..000000000 --- a/channels/rdpdbg/rdpdbg_main.c +++ /dev/null @@ -1,74 +0,0 @@ -/** - * FreeRDP: A Remote Desktop Protocol client. - * Debugging Virtual Channel - * - * Copyright 2010-2011 Marc-Andre Moreau - * Copyright 2011 Vic Lee - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#include - -typedef struct rdpdbg_plugin rdpdbgPlugin; -struct rdpdbg_plugin -{ - rdpSvcPlugin plugin; -}; - -static void rdpdbg_process_connect(rdpSvcPlugin* plugin) -{ - DEBUG_WARN("connecting"); -} - -static void rdpdbg_process_receive(rdpSvcPlugin* plugin, STREAM* data_in) -{ - STREAM* data_out; - - DEBUG_WARN("size %d", stream_get_size(data_in)); - stream_free(data_in); - - data_out = stream_new(8); - stream_write(data_out, "senddata", 8); - svc_plugin_send(plugin, data_out); -} - -static void rdpdbg_process_event(rdpSvcPlugin* plugin, RDP_EVENT* event) -{ - DEBUG_WARN("event_type %d", event->event_type); - freerdp_event_free(event); - - event = freerdp_event_new(RDP_EVENT_CLASS_DEBUG, 0, NULL, NULL); - svc_plugin_send_event(plugin, event); -} - -static void rdpdbg_process_terminate(rdpSvcPlugin* plugin) -{ - DEBUG_WARN("terminating"); - xfree(plugin); -} - -DEFINE_SVC_PLUGIN(rdpdbg, "rdpdbg", - CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP | - CHANNEL_OPTION_COMPRESS_RDP | CHANNEL_OPTION_SHOW_PROTOCOL) diff --git a/channels/rdpdr/ChannelOptions.cmake b/channels/rdpdr/ChannelOptions.cmake new file mode 100644 index 000000000..85e3f63b5 --- /dev/null +++ b/channels/rdpdr/ChannelOptions.cmake @@ -0,0 +1,14 @@ + +set(CHANNEL_TYPE "static") +set(CHANNEL_SHORT_NAME "rdpdr") +set(CHANNEL_LONG_NAME "Device Redirection Virtual Channel Extension") +set(CHANNEL_SPECIFICATIONS "[MS-RDPEFS] [MS-RDPEPC] [MS-RDPESC] [MS-RDPESP]") + +string(TOUPPER "WITH_${CHANNEL_SHORT_NAME}" CHANNEL_OPTION) + +if(WIN32) + option(${CHANNEL_OPTION} "Build ${CHANNEL_SHORT_NAME}" OFF) +else() + option(${CHANNEL_OPTION} "Build ${CHANNEL_SHORT_NAME}" ON) +endif() + diff --git a/channels/rdpsnd/ChannelOptions.cmake b/channels/rdpsnd/ChannelOptions.cmake new file mode 100644 index 000000000..fb8b2ef2a --- /dev/null +++ b/channels/rdpsnd/ChannelOptions.cmake @@ -0,0 +1,12 @@ + +set(CHANNEL_TYPE "static") +set(CHANNEL_SHORT_NAME "rdpsnd") +set(CHANNEL_LONG_NAME "Audio Output Virtual Channel Extension") +set(CHANNEL_SPECIFICATIONS "[MS-RDPEA]") + +if(WIN32) + option(${CHANNEL_OPTION} "Build ${CHANNEL_SHORT_NAME}" OFF) +else() + option(${CHANNEL_OPTION} "Build ${CHANNEL_SHORT_NAME}" ON) +endif() + diff --git a/channels/skel/ChannelOptions.cmake b/channels/skel/ChannelOptions.cmake new file mode 100644 index 000000000..9125cb227 --- /dev/null +++ b/channels/skel/ChannelOptions.cmake @@ -0,0 +1,8 @@ + +set(CHANNEL_TYPE "static") +set(CHANNEL_SHORT_NAME "skel") +set(CHANNEL_LONG_NAME "Skeleton Code Virtual Channel Extension") +set(CHANNEL_SPECIFICATIONS "") + +option(${CHANNEL_OPTION} "Build ${CHANNEL_SHORT_NAME}" OFF) +