channels: refactoring of cmake build scripts
This commit is contained in:
parent
24fc026783
commit
cb8c0ef3c8
@ -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()
|
||||
|
10
channels/cliprdr/ChannelOptions.cmake
Normal file
10
channels/cliprdr/ChannelOptions.cmake
Normal file
@ -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)
|
||||
|
||||
|
9
channels/drdynvc/ChannelOptions.cmake
Normal file
9
channels/drdynvc/ChannelOptions.cmake
Normal file
@ -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)
|
||||
|
9
channels/rail/ChannelOptions.cmake
Normal file
9
channels/rail/ChannelOptions.cmake
Normal file
@ -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)
|
||||
|
@ -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 <otavio@ossystems.com.br>
|
||||
# Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
#
|
||||
# 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})
|
@ -1,74 +0,0 @@
|
||||
/**
|
||||
* FreeRDP: A Remote Desktop Protocol client.
|
||||
* Debugging Virtual Channel
|
||||
*
|
||||
* Copyright 2010-2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
* 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 <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <freerdp/constants.h>
|
||||
#include <freerdp/types.h>
|
||||
#include <freerdp/utils/memory.h>
|
||||
#include <freerdp/utils/svc_plugin.h>
|
||||
|
||||
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)
|
14
channels/rdpdr/ChannelOptions.cmake
Normal file
14
channels/rdpdr/ChannelOptions.cmake
Normal file
@ -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()
|
||||
|
12
channels/rdpsnd/ChannelOptions.cmake
Normal file
12
channels/rdpsnd/ChannelOptions.cmake
Normal file
@ -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()
|
||||
|
8
channels/skel/ChannelOptions.cmake
Normal file
8
channels/skel/ChannelOptions.cmake
Normal file
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user