2012-10-09 07:02:04 +04:00
|
|
|
# FreeRDP: A Remote Desktop Protocol Implementation
|
2012-10-06 00:01:59 +04:00
|
|
|
# FreeRDP cmake build script
|
|
|
|
#
|
|
|
|
# Copyright 2012 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(MODULE_NAME "freerdp-channels-client")
|
|
|
|
set(MODULE_PREFIX "FREERDP_CHANNELS_CLIENT")
|
|
|
|
|
|
|
|
set(${MODULE_PREFIX}_SRCS
|
2013-08-12 15:41:11 +04:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/tables.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/tables.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/addin.c
|
2014-02-11 08:13:29 +04:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/addin.h)
|
2012-10-06 00:01:59 +04:00
|
|
|
|
2014-12-12 20:26:45 +03:00
|
|
|
if(CHANNEL_STATIC_CLIENT_ENTRIES)
|
2012-10-16 00:31:41 +04:00
|
|
|
list(REMOVE_DUPLICATES CHANNEL_STATIC_CLIENT_ENTRIES)
|
2014-12-12 20:26:45 +03:00
|
|
|
endif()
|
2012-10-08 06:53:24 +04:00
|
|
|
|
2012-10-16 00:31:41 +04:00
|
|
|
foreach(STATIC_ENTRY ${CHANNEL_STATIC_CLIENT_ENTRIES})
|
|
|
|
foreach(STATIC_MODULE ${CHANNEL_STATIC_CLIENT_MODULES})
|
|
|
|
if(${${STATIC_MODULE}_CLIENT_ENTRY} STREQUAL ${STATIC_ENTRY})
|
|
|
|
set(STATIC_MODULE_NAME ${${STATIC_MODULE}_CLIENT_NAME})
|
2012-10-17 10:14:19 +04:00
|
|
|
set(STATIC_MODULE_CHANNEL ${${STATIC_MODULE}_CLIENT_CHANNEL})
|
2012-10-16 00:31:41 +04:00
|
|
|
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${STATIC_MODULE_NAME})
|
|
|
|
|
2012-10-17 10:14:19 +04:00
|
|
|
set(ENTRY_POINT_NAME "${STATIC_MODULE_CHANNEL}_${${STATIC_MODULE}_CLIENT_ENTRY}")
|
2014-03-04 09:39:22 +04:00
|
|
|
if(${${STATIC_MODULE}_CLIENT_ENTRY} STREQUAL "VirtualChannelEntry")
|
|
|
|
set(ENTRY_POINT_IMPORT "extern BOOL VCAPITYPE ${ENTRY_POINT_NAME}(PCHANNEL_ENTRY_POINTS);")
|
|
|
|
else()
|
2015-06-03 16:34:43 +03:00
|
|
|
set(ENTRY_POINT_IMPORT "extern WIN32ERROR ${ENTRY_POINT_NAME}();")
|
2014-03-04 09:39:22 +04:00
|
|
|
endif()
|
2012-10-16 00:31:41 +04:00
|
|
|
set(${STATIC_ENTRY}_IMPORTS "${${STATIC_ENTRY}_IMPORTS}\n${ENTRY_POINT_IMPORT}")
|
2012-10-19 21:10:42 +04:00
|
|
|
set(${STATIC_ENTRY}_TABLE "${${STATIC_ENTRY}_TABLE}\n\t{ \"${STATIC_MODULE_CHANNEL}\", ${ENTRY_POINT_NAME} },")
|
2012-10-16 00:31:41 +04:00
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
endforeach()
|
2012-10-08 06:53:24 +04:00
|
|
|
|
2012-10-16 00:31:41 +04:00
|
|
|
set(CLIENT_STATIC_ENTRY_TABLES_LIST "${CLIENT_STATIC_ENTRY_TABLES_LIST}\nconst STATIC_ENTRY_TABLE CLIENT_STATIC_ENTRY_TABLES[] =\n{")
|
2012-10-15 22:44:46 +04:00
|
|
|
|
2012-10-16 00:31:41 +04:00
|
|
|
foreach(STATIC_ENTRY ${CHANNEL_STATIC_CLIENT_ENTRIES})
|
|
|
|
set(CLIENT_STATIC_ENTRY_IMPORTS "${CLIENT_STATIC_ENTRY_IMPORTS}\n${${STATIC_ENTRY}_IMPORTS}")
|
|
|
|
set(CLIENT_STATIC_ENTRY_TABLES "${CLIENT_STATIC_ENTRY_TABLES}\nconst STATIC_ENTRY CLIENT_${STATIC_ENTRY}_TABLE[] =\n{")
|
|
|
|
set(CLIENT_STATIC_ENTRY_TABLES "${CLIENT_STATIC_ENTRY_TABLES}\n${${STATIC_ENTRY}_TABLE}")
|
2013-01-29 03:42:32 +04:00
|
|
|
set(CLIENT_STATIC_ENTRY_TABLES "${CLIENT_STATIC_ENTRY_TABLES}\n\t{ NULL, NULL }\n};")
|
2012-10-16 00:31:41 +04:00
|
|
|
set(CLIENT_STATIC_ENTRY_TABLES_LIST "${CLIENT_STATIC_ENTRY_TABLES_LIST}\n\t{ \"${STATIC_ENTRY}\", CLIENT_${STATIC_ENTRY}_TABLE },")
|
2012-10-08 06:53:24 +04:00
|
|
|
endforeach()
|
|
|
|
|
2013-01-29 03:42:32 +04:00
|
|
|
set(CLIENT_STATIC_ENTRY_TABLES_LIST "${CLIENT_STATIC_ENTRY_TABLES_LIST}\n\t{ NULL, NULL }\n};")
|
2012-10-08 06:53:24 +04:00
|
|
|
|
2012-11-06 04:55:15 +04:00
|
|
|
set(CLIENT_STATIC_ADDIN_TABLE "const STATIC_ADDIN_TABLE CLIENT_STATIC_ADDIN_TABLE[] =\n{")
|
|
|
|
foreach(STATIC_MODULE ${CHANNEL_STATIC_CLIENT_MODULES})
|
|
|
|
set(STATIC_MODULE_NAME ${${STATIC_MODULE}_CLIENT_NAME})
|
|
|
|
set(STATIC_MODULE_CHANNEL ${${STATIC_MODULE}_CLIENT_CHANNEL})
|
|
|
|
string(TOUPPER "CLIENT_${STATIC_MODULE_CHANNEL}_SUBSYSTEM_TABLE" SUBSYSTEM_TABLE_NAME)
|
|
|
|
set(SUBSYSTEM_TABLE "const STATIC_SUBSYSTEM_ENTRY ${SUBSYSTEM_TABLE_NAME}[] =\n{")
|
|
|
|
get_target_property(CHANNEL_SUBSYSTEMS ${STATIC_MODULE_NAME} SUBSYSTEMS)
|
|
|
|
if(CHANNEL_SUBSYSTEMS MATCHES "NOTFOUND")
|
|
|
|
set(CHANNEL_SUBSYSTEMS "")
|
|
|
|
endif()
|
|
|
|
foreach(STATIC_SUBSYSTEM ${CHANNEL_SUBSYSTEMS})
|
2012-11-20 07:31:15 +04:00
|
|
|
if(${STATIC_SUBSYSTEM} MATCHES "^([^-]*)-(.*)")
|
|
|
|
string(REGEX REPLACE "^([^-]*)-(.*)" "\\1" STATIC_SUBSYSTEM_NAME ${STATIC_SUBSYSTEM})
|
|
|
|
string(REGEX REPLACE "^([^-]*)-(.*)" "\\2" STATIC_SUBSYSTEM_TYPE ${STATIC_SUBSYSTEM})
|
|
|
|
else()
|
|
|
|
set(STATIC_SUBSYSTEM_NAME "${STATIC_SUBSYSTEM}")
|
|
|
|
set(STATIC_SUBSYSTEM_TYPE "")
|
|
|
|
endif()
|
|
|
|
string(LENGTH "${STATIC_SUBSYSTEM_TYPE}" _type_length)
|
2012-11-06 04:55:15 +04:00
|
|
|
set(SUBSYSTEM_MODULE_NAME "${STATIC_MODULE_NAME}-${STATIC_SUBSYSTEM}")
|
|
|
|
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${SUBSYSTEM_MODULE_NAME})
|
2012-11-20 07:31:15 +04:00
|
|
|
if(_type_length GREATER 0)
|
|
|
|
set(STATIC_SUBSYSTEM_ENTRY "${STATIC_SUBSYSTEM_NAME}_freerdp_${STATIC_MODULE_CHANNEL}_client_${STATIC_SUBSYSTEM_TYPE}_subsystem_entry")
|
|
|
|
else()
|
|
|
|
set(STATIC_SUBSYSTEM_ENTRY "${STATIC_SUBSYSTEM_NAME}_freerdp_${STATIC_MODULE_CHANNEL}_client_subsystem_entry")
|
|
|
|
endif()
|
|
|
|
set(SUBSYSTEM_TABLE "${SUBSYSTEM_TABLE}\n\t{ \"${STATIC_SUBSYSTEM_NAME}\", \"${STATIC_SUBSYSTEM_TYPE}\", ${STATIC_SUBSYSTEM_ENTRY} },")
|
2012-11-06 04:55:15 +04:00
|
|
|
set(SUBSYSTEM_IMPORT "extern void ${STATIC_SUBSYSTEM_ENTRY}();")
|
|
|
|
set(CLIENT_STATIC_SUBSYSTEM_IMPORTS "${CLIENT_STATIC_SUBSYSTEM_IMPORTS}\n${SUBSYSTEM_IMPORT}")
|
|
|
|
endforeach()
|
2012-11-06 05:58:58 +04:00
|
|
|
set(SUBSYSTEM_TABLE "${SUBSYSTEM_TABLE}\n\t{ NULL, NULL, NULL }\n};")
|
2012-11-06 04:55:15 +04:00
|
|
|
set(CLIENT_STATIC_SUBSYSTEM_TABLES "${CLIENT_STATIC_SUBSYSTEM_TABLES}\n${SUBSYSTEM_TABLE}")
|
|
|
|
set(ENTRY_POINT_NAME "${STATIC_MODULE_CHANNEL}_${${STATIC_MODULE}_CLIENT_ENTRY}")
|
|
|
|
set(CLIENT_STATIC_ADDIN_TABLE "${CLIENT_STATIC_ADDIN_TABLE}\n\t{ \"${STATIC_MODULE_CHANNEL}\", ${ENTRY_POINT_NAME}, ${SUBSYSTEM_TABLE_NAME} },")
|
|
|
|
endforeach()
|
|
|
|
set(CLIENT_STATIC_ADDIN_TABLE "${CLIENT_STATIC_ADDIN_TABLE}\n\t{ NULL, NULL, NULL }\n};")
|
|
|
|
|
2013-08-12 15:41:11 +04:00
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tables.c.in ${CMAKE_CURRENT_BINARY_DIR}/tables.c)
|
2012-10-08 06:53:24 +04:00
|
|
|
|
2014-09-12 02:19:53 +04:00
|
|
|
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} freerdp winpr)
|
2012-10-16 01:03:34 +04:00
|
|
|
|
2012-10-19 21:10:42 +04:00
|
|
|
set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} PARENT_SCOPE)
|
|
|
|
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE)
|