2019-05-17 15:32:54 +03:00
|
|
|
# FreeRDP: A Remote Desktop Protocol Implementation
|
|
|
|
# FreeRDP Proxy Server
|
|
|
|
#
|
|
|
|
# Copyright 2019 Mati Shabtay <matishabtay@gmail.com>
|
|
|
|
# Copyright 2019 Kobi Mizrachi <kmizrachi18@gmail.com>
|
2019-08-19 16:05:59 +03:00
|
|
|
# Copyright 2019 Idan Freiberg <speidy@gmail.com>
|
2021-09-01 14:30:09 +03:00
|
|
|
# Copyright 2021 Armin Novak <anovak@thincast.com>
|
|
|
|
# Copyright 2021 Thincast Technologies GmbH
|
|
|
|
#
|
2019-05-17 15:32:54 +03:00
|
|
|
# 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.
|
|
|
|
|
2020-03-09 11:14:50 +03:00
|
|
|
include(CMakeDependentOption)
|
2021-08-24 13:50:13 +03:00
|
|
|
set(MODULE_NAME "freerdp-server-proxy")
|
2019-05-17 15:32:54 +03:00
|
|
|
set(MODULE_PREFIX "FREERDP_SERVER_PROXY")
|
|
|
|
|
|
|
|
set(${MODULE_PREFIX}_SRCS
|
|
|
|
pf_context.c
|
|
|
|
pf_client.c
|
|
|
|
pf_client.h
|
|
|
|
pf_input.c
|
|
|
|
pf_input.h
|
|
|
|
pf_update.c
|
|
|
|
pf_update.h
|
|
|
|
pf_server.c
|
|
|
|
pf_server.h
|
|
|
|
pf_config.c
|
2019-08-19 16:05:59 +03:00
|
|
|
pf_modules.c
|
2021-08-24 13:50:13 +03:00
|
|
|
pf_utils.h
|
|
|
|
pf_utils.c
|
2019-08-19 16:05:59 +03:00
|
|
|
)
|
2019-05-17 15:32:54 +03:00
|
|
|
|
2021-08-24 13:50:13 +03:00
|
|
|
set(PROXY_APP_SRCS freerdp_proxy.c)
|
|
|
|
|
2019-05-17 15:32:54 +03:00
|
|
|
# On windows create dll version information.
|
|
|
|
# Vendor, product and year are already set in top level CMakeLists.txt
|
|
|
|
if (WIN32)
|
|
|
|
set (RC_VERSION_MAJOR ${FREERDP_VERSION_MAJOR})
|
|
|
|
set (RC_VERSION_MINOR ${FREERDP_VERSION_MINOR})
|
|
|
|
set (RC_VERSION_BUILD ${FREERDP_VERSION_REVISION})
|
|
|
|
set (RC_VERSION_FILE "${MODULE_NAME}${CMAKE_EXECUTABLE_SUFFIX}" )
|
|
|
|
|
|
|
|
configure_file(
|
2021-06-21 12:39:34 +03:00
|
|
|
${PROJECT_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in
|
2019-05-17 15:32:54 +03:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/version.rc
|
|
|
|
@ONLY)
|
|
|
|
|
|
|
|
set ( ${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
|
2021-08-24 13:50:13 +03:00
|
|
|
list(APPEND PROXY_APP_SRCS ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
|
2019-05-17 15:32:54 +03:00
|
|
|
endif()
|
|
|
|
|
2021-08-24 13:50:13 +03:00
|
|
|
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
|
|
|
|
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME ${MODULE_NAME}${FREERDP_API_VERSION})
|
|
|
|
|
|
|
|
if (WITH_LIBRARY_VERSIONING)
|
|
|
|
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVERSION ${FREERDP_API_VERSION})
|
|
|
|
endif()
|
2019-05-17 15:32:54 +03:00
|
|
|
|
|
|
|
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} freerdp-server)
|
|
|
|
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} freerdp-client)
|
2021-08-24 13:50:13 +03:00
|
|
|
if (NOT BUILTIN_CHANNELS)
|
|
|
|
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} rdpgfx-client)
|
|
|
|
get_target_property(CUR_INSTALL_RPATH ${MODULE_NAME} INSTALL_RPATH)
|
|
|
|
if (NOT APPLE)
|
|
|
|
set(CUR_INSTALL_RPATH "${CUR_INSTALL_RPATH}:\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}/freerdp${FREERDP_VERSION_MAJOR}")
|
|
|
|
endif()
|
|
|
|
set_target_properties(${MODULE_NAME} PROPERTIES INSTALL_RPATH ${CUR_INSTALL_RPATH})
|
|
|
|
endif()
|
2019-05-17 15:32:54 +03:00
|
|
|
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr freerdp)
|
|
|
|
|
|
|
|
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
|
2021-08-24 13:50:13 +03:00
|
|
|
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT server EXPORT FreeRDP-ProxyTargets)
|
2019-05-17 15:32:54 +03:00
|
|
|
if (WITH_DEBUG_SYMBOLS AND MSVC)
|
2021-09-22 17:00:00 +03:00
|
|
|
install(FILES ${CMAKE_PDB_BINARY_DIR}/${MODULE_NAME}${FREERDP_VERSION_MAJOR}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT symbols)
|
2019-05-17 15:32:54 +03:00
|
|
|
endif()
|
2021-08-24 13:50:13 +03:00
|
|
|
# pkg-config
|
2021-09-22 17:00:00 +03:00
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/freerdp-proxy.pc.in ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}${FREERDP_VERSION_MAJOR}.pc @ONLY)
|
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}${FREERDP_VERSION_MAJOR}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
2021-08-24 13:50:13 +03:00
|
|
|
|
|
|
|
export(PACKAGE freerdp-proxy)
|
|
|
|
|
|
|
|
SetFreeRDPCMakeInstallDir(FREERDP_PROXY_CMAKE_INSTALL_DIR "FreeRDP-Proxy${FREERDP_VERSION_MAJOR}")
|
|
|
|
|
|
|
|
configure_package_config_file(FreeRDP-ProxyConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ProxyConfig.cmake
|
|
|
|
INSTALL_DESTINATION ${FREERDP_PROXY_CMAKE_INSTALL_DIR}
|
|
|
|
PATH_VARS FREERDP_INCLUDE_DIR)
|
|
|
|
|
|
|
|
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ProxyConfigVersion.cmake
|
|
|
|
VERSION ${FREERDP_VERSION} COMPATIBILITY SameMajorVersion)
|
|
|
|
|
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ProxyConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ProxyConfigVersion.cmake
|
|
|
|
DESTINATION ${FREERDP_PROXY_CMAKE_INSTALL_DIR})
|
|
|
|
install(EXPORT FreeRDP-ProxyTargets DESTINATION ${FREERDP_PROXY_CMAKE_INSTALL_DIR})
|
2019-05-17 15:32:54 +03:00
|
|
|
|
|
|
|
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/proxy")
|
2019-05-26 15:29:41 +03:00
|
|
|
|
2021-08-24 13:50:13 +03:00
|
|
|
option(WITH_PROXY_APP "Compile proxy application" ON)
|
|
|
|
|
|
|
|
if (WITH_PROXY_APP)
|
|
|
|
add_subdirectory("cli")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
option(WITH_PROXY_MODULES "Compile proxy modules" ON)
|
2020-01-13 13:30:09 +03:00
|
|
|
if (WITH_PROXY_MODULES)
|
|
|
|
add_subdirectory("modules")
|
|
|
|
endif()
|