mirror of https://github.com/FreeRDP/FreeRDP
[build] removed complex libraries
* remove obsolete complex libraries helper * fix static linking
This commit is contained in:
parent
c054666311
commit
b4e9c8b39f
|
@ -69,7 +69,6 @@ include(TestBigEndian)
|
||||||
include(FindFeature)
|
include(FindFeature)
|
||||||
include(ShowCMakeVars)
|
include(ShowCMakeVars)
|
||||||
include(ConfigOptions)
|
include(ConfigOptions)
|
||||||
include(ComplexLibrary)
|
|
||||||
include(FeatureSummary)
|
include(FeatureSummary)
|
||||||
include(CheckCCompilerFlag)
|
include(CheckCCompilerFlag)
|
||||||
include(GNUInstallDirsWrapper)
|
include(GNUInstallDirsWrapper)
|
||||||
|
|
|
@ -162,16 +162,6 @@ macro(add_channel_client_subsystem _channel_prefix _channel_name _subsystem _typ
|
||||||
endif()
|
endif()
|
||||||
endmacro(add_channel_client_subsystem)
|
endmacro(add_channel_client_subsystem)
|
||||||
|
|
||||||
macro(channel_install _targets _destination _export_target)
|
|
||||||
if (NOT BUILD_SHARED_LIBS)
|
|
||||||
install(TARGETS ${_targets} DESTINATION ${_destination} EXPORT ${_export_target})
|
|
||||||
endif()
|
|
||||||
endmacro(channel_install)
|
|
||||||
|
|
||||||
macro(client_channel_install _targets _destination)
|
|
||||||
channel_install(${_targets} ${_destination} "FreeRDP-ClientTargets")
|
|
||||||
endmacro(client_channel_install)
|
|
||||||
|
|
||||||
macro(add_channel_client_library _module_prefix _module_name _channel_name _dynamic _entry)
|
macro(add_channel_client_library _module_prefix _module_name _channel_name _dynamic _entry)
|
||||||
set(_lnk_dir ${${_module_prefix}_LINK_DIRS})
|
set(_lnk_dir ${${_module_prefix}_LINK_DIRS})
|
||||||
if (NOT "${_lnk_dir}" STREQUAL "")
|
if (NOT "${_lnk_dir}" STREQUAL "")
|
||||||
|
@ -204,13 +194,11 @@ macro(add_channel_client_subsystem_library _module_prefix _module_name _channel_
|
||||||
|
|
||||||
add_library(${_module_name} STATIC ${${_module_prefix}_SRCS})
|
add_library(${_module_name} STATIC ${${_module_prefix}_SRCS})
|
||||||
set_property(TARGET ${_module_name} PROPERTY POSITION_INDEPENDENT_CODE ON)
|
set_property(TARGET ${_module_name} PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||||
set_property(TARGET ${_module_name} PROPERTY FOLDER "Channels/${_channel_name}/Client/Subsystem/${_module_name}")
|
set_property(TARGET ${_module_name} PROPERTY FOLDER "Channels/${_channel_name}/Client/Subsystem/${CHANNEL_SUBSYSTEM}")
|
||||||
|
|
||||||
if (${_module_prefix}_LIBS)
|
if (${_module_prefix}_LIBS)
|
||||||
target_link_libraries(${_module_name} PRIVATE ${${_module_prefix}_LIBS})
|
target_link_libraries(${_module_name} PRIVATE ${${_module_prefix}_LIBS})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH})
|
|
||||||
endmacro(add_channel_client_subsystem_library)
|
endmacro(add_channel_client_subsystem_library)
|
||||||
|
|
||||||
macro(add_channel_server_library _module_prefix _module_name _channel_name _dynamic _entry)
|
macro(add_channel_server_library _module_prefix _module_name _channel_name _dynamic _entry)
|
||||||
|
@ -228,7 +216,7 @@ macro(add_channel_server_library _module_prefix _module_name _channel_name _dyna
|
||||||
set_property(TARGET ${_module_name} PROPERTY POSITION_INDEPENDENT_CODE ON)
|
set_property(TARGET ${_module_name} PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||||
set_property(TARGET ${_module_name} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Server")
|
set_property(TARGET ${_module_name} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Server")
|
||||||
|
|
||||||
if (${_module_prefix}_LIBS/su)
|
if (${_module_prefix}_LIBS)
|
||||||
target_link_libraries(${_module_name} PRIVATE ${${_module_prefix}_LIBS})
|
target_link_libraries(${_module_name} PRIVATE ${${_module_prefix}_LIBS})
|
||||||
endif()
|
endif()
|
||||||
endmacro(add_channel_server_library)
|
endmacro(add_channel_server_library)
|
||||||
|
|
|
@ -107,4 +107,6 @@ write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ClientConfi
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ClientConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ClientConfigVersion.cmake
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ClientConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ClientConfigVersion.cmake
|
||||||
DESTINATION ${FREERDP_CLIENT_CMAKE_INSTALL_DIR})
|
DESTINATION ${FREERDP_CLIENT_CMAKE_INSTALL_DIR})
|
||||||
|
|
||||||
install(EXPORT FreeRDP-ClientTargets DESTINATION ${FREERDP_CLIENT_CMAKE_INSTALL_DIR})
|
if (CMAKE_BUILD_SHARED)
|
||||||
|
install(EXPORT FreeRDP-ClientTargets DESTINATION ${FREERDP_CLIENT_CMAKE_INSTALL_DIR})
|
||||||
|
endif()
|
||||||
|
|
|
@ -25,7 +25,7 @@ if(POLICY CMP0022)
|
||||||
cmake_policy(SET CMP0022 NEW)
|
cmake_policy(SET CMP0022 NEW)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(${MODULE_PREFIX}_SRCS
|
set(SRCS
|
||||||
client.c
|
client.c
|
||||||
client_rails.c
|
client_rails.c
|
||||||
cmdline.c
|
cmdline.c
|
||||||
|
@ -36,7 +36,7 @@ set(${MODULE_PREFIX}_SRCS
|
||||||
foreach(FREERDP_CHANNELS_CLIENT_SRC ${FREERDP_CHANNELS_CLIENT_SRCS})
|
foreach(FREERDP_CHANNELS_CLIENT_SRC ${FREERDP_CHANNELS_CLIENT_SRCS})
|
||||||
get_filename_component(NINC ${FREERDP_CHANNELS_CLIENT_SRC} PATH)
|
get_filename_component(NINC ${FREERDP_CHANNELS_CLIENT_SRC} PATH)
|
||||||
include_directories(${NINC})
|
include_directories(${NINC})
|
||||||
set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} "${FREERDP_CHANNELS_CLIENT_SRC}")
|
list(APPEND SRCS "${FREERDP_CHANNELS_CLIENT_SRC}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,26 +53,22 @@ if (WIN32 AND BUILD_SHARED_LIBS)
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/version.rc
|
${CMAKE_CURRENT_BINARY_DIR}/version.rc
|
||||||
@ONLY)
|
@ONLY)
|
||||||
|
|
||||||
set ( ${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
|
list (APPEND SRCS ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
|
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||||
|
|
||||||
|
add_library(${MODULE_NAME} ${SRCS})
|
||||||
|
|
||||||
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME ${MODULE_NAME}${FREERDP_API_VERSION})
|
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME ${MODULE_NAME}${FREERDP_API_VERSION})
|
||||||
include_directories(${OPENSSL_INCLUDE_DIR})
|
|
||||||
if (WITH_LIBRARY_VERSIONING)
|
if (WITH_LIBRARY_VERSIONING)
|
||||||
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVERSION ${FREERDP_API_VERSION})
|
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVERSION ${FREERDP_API_VERSION})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND ${MODULE_PREFIX}_LIBS freerdp winpr)
|
set(LIBS freerdp winpr)
|
||||||
|
|
||||||
target_link_libraries(${MODULE_NAME} PRIVATE ${FREERDP_CHANNELS_CLIENT_LIBS})
|
target_link_libraries(${MODULE_NAME} PRIVATE ${FREERDP_CHANNELS_CLIENT_LIBS})
|
||||||
if(OPENBSD)
|
target_link_libraries(${MODULE_NAME} PUBLIC ${LIBS})
|
||||||
target_link_libraries(${MODULE_NAME} PUBLIC ${${MODULE_PREFIX}_LIBS} sndio)
|
|
||||||
else()
|
|
||||||
target_link_libraries(${MODULE_NAME} PUBLIC ${${MODULE_PREFIX}_LIBS})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
install(TARGETS ${MODULE_NAME} COMPONENT libraries EXPORT FreeRDP-ClientTargets
|
install(TARGETS ${MODULE_NAME} COMPONENT libraries EXPORT FreeRDP-ClientTargets
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
@ -89,5 +85,3 @@ set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Client/Common")
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
export_complex_library(LIBNAME ${MODULE_NAME})
|
|
||||||
|
|
|
@ -1,90 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
include(EchoTarget)
|
|
||||||
include(CMakeParseArguments)
|
|
||||||
|
|
||||||
# - add a new library to a module for export
|
|
||||||
# MODULE - module the library belongs to
|
|
||||||
# LIBNAME - name of the library
|
|
||||||
# - if MODULE isn't set the NAME should must be in the form MODULE-NAME
|
|
||||||
function(export_complex_library)
|
|
||||||
set(PREFIX "EXPORT_COMPLEX_LIBRARY")
|
|
||||||
cmake_parse_arguments(${PREFIX}
|
|
||||||
""
|
|
||||||
"LIBNAME;MODULE"
|
|
||||||
""
|
|
||||||
${ARGN})
|
|
||||||
|
|
||||||
if (NOT ${PREFIX}_LIBNAME)
|
|
||||||
message(FATAL_ERROR "export_complex_library requires a name to be set")
|
|
||||||
endif()
|
|
||||||
if (NOT ${PREFIX}_MODULE)
|
|
||||||
# get the module prefix and remove it from libname
|
|
||||||
string(REPLACE "-" ";" LIBNAME_LIST "${${PREFIX}_LIBNAME}")
|
|
||||||
list(GET LIBNAME_LIST 0 MODULE)
|
|
||||||
list(REMOVE_AT LIBNAME_LIST 0)
|
|
||||||
string(REPLACE ";" "-" LIBNAME "${LIBNAME_LIST}")
|
|
||||||
else()
|
|
||||||
set(MODULE ${${PREFIX}_MODULE})
|
|
||||||
set(LIBNAME ${${PREFIX}_LIBNAME})
|
|
||||||
endif()
|
|
||||||
if (NOT MODULE)
|
|
||||||
message(FATAL_ERROR "export_complex_library couldn't identify MODULE")
|
|
||||||
endif()
|
|
||||||
get_property(MEXPORTS GLOBAL PROPERTY ${MODULE}_EXPORTS)
|
|
||||||
list(APPEND MEXPORTS ${LIBNAME})
|
|
||||||
set_property(GLOBAL PROPERTY ${MODULE}_EXPORTS "${MEXPORTS}")
|
|
||||||
endfunction(export_complex_library)
|
|
||||||
|
|
||||||
macro(add_complex_library)
|
|
||||||
|
|
||||||
set(PREFIX "COMPLEX_LIBRARY")
|
|
||||||
|
|
||||||
cmake_parse_arguments(${PREFIX}
|
|
||||||
"EXPORT"
|
|
||||||
"MODULE;TYPE;MONOLITHIC"
|
|
||||||
"SOURCES"
|
|
||||||
${ARGN})
|
|
||||||
|
|
||||||
string(TOUPPER "${${PREFIX}_MODULE}_TYPE" ${PREFIX}_TYPE_OPTION)
|
|
||||||
string(REGEX REPLACE "-" "_" ${PREFIX}_TYPE_OPTION ${${PREFIX}_TYPE_OPTION})
|
|
||||||
|
|
||||||
if(${${PREFIX}_MONOLITHIC})
|
|
||||||
add_library(${${PREFIX}_MODULE} ${${PREFIX}_TYPE} ${${PREFIX}_SOURCES})
|
|
||||||
else()
|
|
||||||
if (NOT DEFINED ${${PREFIX}_TYPE_OPTION})
|
|
||||||
add_library(${${PREFIX}_MODULE} ${${PREFIX}_SOURCES})
|
|
||||||
else()
|
|
||||||
add_library(${${PREFIX}_MODULE} ${${${PREFIX}_TYPE_OPTION}} ${${PREFIX}_SOURCES})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
if (${PREFIX}_EXPORT)
|
|
||||||
export_complex_library(LIBNAME ${${PREFIX}_MODULE})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
endmacro(add_complex_library)
|
|
||||||
|
|
||||||
function(create_object_cotarget target)
|
|
||||||
|
|
||||||
set(cotarget "${target}-objects")
|
|
||||||
|
|
||||||
get_target_property(${target}_TYPE ${target} TYPE)
|
|
||||||
|
|
||||||
if(NOT ((${target}_TYPE MATCHES "SHARED_LIBRARY") OR (${target}_TYPE MATCHES "SHARED_LIBRARY")))
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
get_target_property(${target}_SOURCES ${target} SOURCES)
|
|
||||||
get_target_property(${target}_LINK_LIBRARIES ${target} LINK_LIBRARIES)
|
|
||||||
get_target_property(${target}_INCLUDE_DIRECTORIES ${target} INCLUDE_DIRECTORIES)
|
|
||||||
|
|
||||||
add_library(${cotarget} "OBJECT" ${${target}_SOURCES})
|
|
||||||
|
|
||||||
set_target_properties(${cotarget} PROPERTIES LINK_LIBRARIES "${${target}_LINK_LIBRARIES}")
|
|
||||||
set_target_properties(${cotarget} PROPERTIES INCLUDE_DIRECTORIES "${${target}_INCLUDE_DIRECTORIES}")
|
|
||||||
|
|
||||||
echo_target(${target})
|
|
||||||
echo_target(${cotarget})
|
|
||||||
|
|
||||||
endfunction()
|
|
||||||
|
|
|
@ -1,349 +0,0 @@
|
||||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
||||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
|
||||||
|
|
||||||
#.rst:
|
|
||||||
# FindICU
|
|
||||||
# -------
|
|
||||||
#
|
|
||||||
# Find the International Components for Unicode (ICU) libraries and
|
|
||||||
# programs.
|
|
||||||
#
|
|
||||||
# This module supports multiple components.
|
|
||||||
# Components can include any of: ``data``, ``i18n``, ``io``, ``le``,
|
|
||||||
# ``lx``, ``test``, ``tu`` and ``uc``.
|
|
||||||
#
|
|
||||||
# Note that on Windows ``data`` is named ``dt`` and ``i18n`` is named
|
|
||||||
# ``in``; any of the names may be used, and the appropriate
|
|
||||||
# platform-specific library name will be automatically selected.
|
|
||||||
#
|
|
||||||
# This module reports information about the ICU installation in
|
|
||||||
# several variables. General variables::
|
|
||||||
#
|
|
||||||
# ICU_VERSION - ICU release version
|
|
||||||
# ICU_FOUND - true if the main programs and libraries were found
|
|
||||||
# ICU_LIBRARIES - component libraries to be linked
|
|
||||||
# ICU_INCLUDE_DIRS - the directories containing the ICU headers
|
|
||||||
#
|
|
||||||
# Imported targets::
|
|
||||||
#
|
|
||||||
# ICU::<C>
|
|
||||||
#
|
|
||||||
# Where ``<C>`` is the name of an ICU component, for example
|
|
||||||
# ``ICU::i18n``.
|
|
||||||
#
|
|
||||||
# ICU programs are reported in::
|
|
||||||
#
|
|
||||||
# ICU_GENCNVAL_EXECUTABLE - path to gencnval executable
|
|
||||||
# ICU_ICUINFO_EXECUTABLE - path to icuinfo executable
|
|
||||||
# ICU_GENBRK_EXECUTABLE - path to genbrk executable
|
|
||||||
# ICU_ICU-CONFIG_EXECUTABLE - path to icu-config executable
|
|
||||||
# ICU_GENRB_EXECUTABLE - path to genrb executable
|
|
||||||
# ICU_GENDICT_EXECUTABLE - path to gendict executable
|
|
||||||
# ICU_DERB_EXECUTABLE - path to derb executable
|
|
||||||
# ICU_PKGDATA_EXECUTABLE - path to pkgdata executable
|
|
||||||
# ICU_UCONV_EXECUTABLE - path to uconv executable
|
|
||||||
# ICU_GENCFU_EXECUTABLE - path to gencfu executable
|
|
||||||
# ICU_MAKECONV_EXECUTABLE - path to makeconv executable
|
|
||||||
# ICU_GENNORM2_EXECUTABLE - path to gennorm2 executable
|
|
||||||
# ICU_GENCCODE_EXECUTABLE - path to genccode executable
|
|
||||||
# ICU_GENSPREP_EXECUTABLE - path to gensprep executable
|
|
||||||
# ICU_ICUPKG_EXECUTABLE - path to icupkg executable
|
|
||||||
# ICU_GENCMN_EXECUTABLE - path to gencmn executable
|
|
||||||
#
|
|
||||||
# ICU component libraries are reported in::
|
|
||||||
#
|
|
||||||
# ICU_<C>_FOUND - ON if component was found
|
|
||||||
# ICU_<C>_LIBRARIES - libraries for component
|
|
||||||
#
|
|
||||||
# Note that ``<C>`` is the uppercased name of the component.
|
|
||||||
#
|
|
||||||
# This module reads hints about search results from::
|
|
||||||
#
|
|
||||||
# ICU_ROOT - the root of the ICU installation
|
|
||||||
#
|
|
||||||
# The environment variable ``ICU_ROOT`` may also be used; the
|
|
||||||
# ICU_ROOT variable takes precedence.
|
|
||||||
#
|
|
||||||
# The following cache variables may also be set::
|
|
||||||
#
|
|
||||||
# ICU_<P>_EXECUTABLE - the path to executable <P>
|
|
||||||
# ICU_INCLUDE_DIR - the directory containing the ICU headers
|
|
||||||
# ICU_<C>_LIBRARY - the library for component <C>
|
|
||||||
#
|
|
||||||
# .. note::
|
|
||||||
#
|
|
||||||
# In most cases none of the above variables will require setting,
|
|
||||||
# unless multiple ICU versions are available and a specific version
|
|
||||||
# is required.
|
|
||||||
#
|
|
||||||
# Other variables one may set to control this module are::
|
|
||||||
#
|
|
||||||
# ICU_DEBUG - Set to ON to enable debug output from FindICU.
|
|
||||||
|
|
||||||
# Written by Roger Leigh <rleigh@codelibre.net>
|
|
||||||
|
|
||||||
set(icu_programs
|
|
||||||
gencnval
|
|
||||||
icuinfo
|
|
||||||
genbrk
|
|
||||||
icu-config
|
|
||||||
genrb
|
|
||||||
gendict
|
|
||||||
derb
|
|
||||||
pkgdata
|
|
||||||
uconv
|
|
||||||
gencfu
|
|
||||||
makeconv
|
|
||||||
gennorm2
|
|
||||||
genccode
|
|
||||||
gensprep
|
|
||||||
icupkg
|
|
||||||
gencmn)
|
|
||||||
|
|
||||||
# The ICU checks are contained in a function due to the large number
|
|
||||||
# of temporary variables needed.
|
|
||||||
function(_ICU_FIND)
|
|
||||||
# Set up search paths, taking compiler into account. Search ICU_ROOT,
|
|
||||||
# with ICU_ROOT in the environment as a fallback if unset.
|
|
||||||
if(ICU_ROOT)
|
|
||||||
list(APPEND icu_roots "${ICU_ROOT}")
|
|
||||||
else()
|
|
||||||
if(NOT "$ENV{ICU_ROOT}" STREQUAL "")
|
|
||||||
file(TO_CMAKE_PATH "$ENV{ICU_ROOT}" NATIVE_PATH)
|
|
||||||
list(APPEND icu_roots "${NATIVE_PATH}")
|
|
||||||
set(ICU_ROOT "${NATIVE_PATH}"
|
|
||||||
CACHE PATH "Location of the ICU installation" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
||||||
# 64-bit binary directory
|
|
||||||
set(_bin64 "bin64")
|
|
||||||
# 64-bit library directory
|
|
||||||
set(_lib64 "lib64")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Generic 64-bit and 32-bit directories
|
|
||||||
list(APPEND icu_binary_suffixes "${_bin64}" "bin")
|
|
||||||
list(APPEND icu_library_suffixes "${_lib64}" "lib")
|
|
||||||
|
|
||||||
# Find all ICU programs
|
|
||||||
foreach(program ${icu_programs})
|
|
||||||
string(TOUPPER "${program}" program_upcase)
|
|
||||||
set(cache_var "ICU_${program_upcase}_EXECUTABLE")
|
|
||||||
set(program_var "ICU_${program_upcase}_EXECUTABLE")
|
|
||||||
find_program("${cache_var}" "${program}"
|
|
||||||
HINTS ${icu_roots}
|
|
||||||
PATH_SUFFIXES ${icu_binary_suffixes}
|
|
||||||
DOC "ICU ${program} executable")
|
|
||||||
mark_as_advanced(cache_var)
|
|
||||||
set("${program_var}" "${${cache_var}}" PARENT_SCOPE)
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
# Find include directory
|
|
||||||
find_path(ICU_INCLUDE_DIR
|
|
||||||
NAMES "unicode/utypes.h"
|
|
||||||
HINTS ${icu_roots}
|
|
||||||
PATH_SUFFIXES ${icu_include_suffixes}
|
|
||||||
DOC "ICU include directory")
|
|
||||||
set(ICU_INCLUDE_DIR "${ICU_INCLUDE_DIR}" PARENT_SCOPE)
|
|
||||||
|
|
||||||
# Get version
|
|
||||||
if(ICU_INCLUDE_DIR AND EXISTS "${ICU_INCLUDE_DIR}/unicode/uvernum.h")
|
|
||||||
file(STRINGS "${ICU_INCLUDE_DIR}/unicode/uvernum.h" icu_header_str
|
|
||||||
REGEX "^#define[\t ]+U_ICU_VERSION[\t ]+\".*\".*")
|
|
||||||
|
|
||||||
string(REGEX REPLACE "^#define[\t ]+U_ICU_VERSION[\t ]+\"([^ \\n]*)\".*"
|
|
||||||
"\\1" icu_version_string "${icu_header_str}")
|
|
||||||
set(ICU_VERSION "${icu_version_string}" PARENT_SCOPE)
|
|
||||||
unset(icu_header_str)
|
|
||||||
unset(icu_version_string)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Find all ICU libraries
|
|
||||||
set(ICU_REQUIRED_LIBS_FOUND ON)
|
|
||||||
foreach(component ${ICU_FIND_COMPONENTS})
|
|
||||||
string(TOUPPER "${component}" component_upcase)
|
|
||||||
set(component_cache "ICU_${component_upcase}_LIBRARY")
|
|
||||||
set(component_cache_release "${component_cache}_RELEASE")
|
|
||||||
set(component_cache_debug "${component_cache}_DEBUG")
|
|
||||||
set(component_found "${component_upcase}_FOUND")
|
|
||||||
set(component_libnames "icu${component}")
|
|
||||||
set(component_debug_libnames "icu${component}d")
|
|
||||||
|
|
||||||
# Special case deliberate library naming mismatches between Unix
|
|
||||||
# and Windows builds
|
|
||||||
unset(component_libnames)
|
|
||||||
unset(component_debug_libnames)
|
|
||||||
list(APPEND component_libnames "icu${component}")
|
|
||||||
list(APPEND component_debug_libnames "icu${component}d")
|
|
||||||
if(component STREQUAL "data")
|
|
||||||
list(APPEND component_libnames "icudt")
|
|
||||||
# Note there is no debug variant at present
|
|
||||||
list(APPEND component_debug_libnames "icudtd")
|
|
||||||
endif()
|
|
||||||
if(component STREQUAL "dt")
|
|
||||||
list(APPEND component_libnames "icudata")
|
|
||||||
# Note there is no debug variant at present
|
|
||||||
list(APPEND component_debug_libnames "icudatad")
|
|
||||||
endif()
|
|
||||||
if(component STREQUAL "i18n")
|
|
||||||
list(APPEND component_libnames "icuin")
|
|
||||||
list(APPEND component_debug_libnames "icuind")
|
|
||||||
endif()
|
|
||||||
if(component STREQUAL "in")
|
|
||||||
list(APPEND component_libnames "icui18n")
|
|
||||||
list(APPEND component_debug_libnames "icui18nd")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_library("${component_cache_release}" ${component_libnames}
|
|
||||||
HINTS ${icu_roots}
|
|
||||||
PATH_SUFFIXES ${icu_library_suffixes}
|
|
||||||
DOC "ICU ${component} library (release)")
|
|
||||||
find_library("${component_cache_debug}" ${component_debug_libnames}
|
|
||||||
HINTS ${icu_roots}
|
|
||||||
PATH_SUFFIXES ${icu_library_suffixes}
|
|
||||||
DOC "ICU ${component} library (debug)")
|
|
||||||
include(SelectLibraryConfigurations)
|
|
||||||
select_library_configurations(ICU_${component_upcase})
|
|
||||||
mark_as_advanced("${component_cache_release}" "${component_cache_debug}")
|
|
||||||
if(${component_cache})
|
|
||||||
set("${component_found}" ON)
|
|
||||||
list(APPEND ICU_LIBRARY "${${component_cache}}")
|
|
||||||
endif()
|
|
||||||
mark_as_advanced("${component_found}")
|
|
||||||
set("${component_cache}" "${${component_cache}}" PARENT_SCOPE)
|
|
||||||
set("${component_found}" "${${component_found}}" PARENT_SCOPE)
|
|
||||||
if(${component_found})
|
|
||||||
if (ICU_FIND_REQUIRED_${component})
|
|
||||||
list(APPEND ICU_LIBS_FOUND "${component} (required)")
|
|
||||||
else()
|
|
||||||
list(APPEND ICU_LIBS_FOUND "${component} (optional)")
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
if (ICU_FIND_REQUIRED_${component})
|
|
||||||
set(ICU_REQUIRED_LIBS_FOUND OFF)
|
|
||||||
list(APPEND ICU_LIBS_NOTFOUND "${component} (required)")
|
|
||||||
else()
|
|
||||||
list(APPEND ICU_LIBS_NOTFOUND "${component} (optional)")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
set(_ICU_REQUIRED_LIBS_FOUND "${ICU_REQUIRED_LIBS_FOUND}" PARENT_SCOPE)
|
|
||||||
set(ICU_LIBRARY "${ICU_LIBRARY}" PARENT_SCOPE)
|
|
||||||
|
|
||||||
if(NOT ICU_FIND_QUIETLY)
|
|
||||||
if(ICU_LIBS_FOUND)
|
|
||||||
message(STATUS "Found the following ICU libraries:")
|
|
||||||
foreach(found ${ICU_LIBS_FOUND})
|
|
||||||
message(STATUS " ${found}")
|
|
||||||
endforeach()
|
|
||||||
endif()
|
|
||||||
if(ICU_LIBS_NOTFOUND)
|
|
||||||
message(STATUS "The following ICU libraries were not found:")
|
|
||||||
foreach(notfound ${ICU_LIBS_NOTFOUND})
|
|
||||||
message(STATUS " ${notfound}")
|
|
||||||
endforeach()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ICU_DEBUG)
|
|
||||||
message(STATUS "--------FindICU.cmake search debug--------")
|
|
||||||
message(STATUS "ICU binary path search order: ${icu_roots}")
|
|
||||||
message(STATUS "ICU include path search order: ${icu_roots}")
|
|
||||||
message(STATUS "ICU library path search order: ${icu_roots}")
|
|
||||||
message(STATUS "----------------")
|
|
||||||
endif()
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
_ICU_FIND()
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ICU
|
|
||||||
FOUND_VAR ICU_FOUND
|
|
||||||
REQUIRED_VARS ICU_INCLUDE_DIR
|
|
||||||
ICU_LIBRARY
|
|
||||||
_ICU_REQUIRED_LIBS_FOUND
|
|
||||||
VERSION_VAR ICU_VERSION
|
|
||||||
FAIL_MESSAGE "Failed to find all ICU components")
|
|
||||||
|
|
||||||
unset(_ICU_REQUIRED_LIBS_FOUND)
|
|
||||||
|
|
||||||
if(ICU_FOUND)
|
|
||||||
set(ICU_INCLUDE_DIRS "${ICU_INCLUDE_DIR}")
|
|
||||||
set(ICU_LIBRARIES "${ICU_LIBRARY}")
|
|
||||||
foreach(_ICU_component ${ICU_FIND_COMPONENTS})
|
|
||||||
string(TOUPPER "${_ICU_component}" _ICU_component_upcase)
|
|
||||||
set(_ICU_component_cache "ICU_${_ICU_component_upcase}_LIBRARY")
|
|
||||||
set(_ICU_component_cache_release "ICU_${_ICU_component_upcase}_LIBRARY_RELEASE")
|
|
||||||
set(_ICU_component_cache_debug "ICU_${_ICU_component_upcase}_LIBRARY_DEBUG")
|
|
||||||
set(_ICU_component_lib "ICU_${_ICU_component_upcase}_LIBRARIES")
|
|
||||||
set(_ICU_component_found "${_ICU_component_upcase}_FOUND")
|
|
||||||
set(_ICU_imported_target "ICU::${_ICU_component}")
|
|
||||||
if(${_ICU_component_found})
|
|
||||||
set("${_ICU_component_lib}" "${${_ICU_component_cache}}")
|
|
||||||
if(NOT TARGET ${_ICU_imported_target})
|
|
||||||
add_library(${_ICU_imported_target} UNKNOWN IMPORTED)
|
|
||||||
if(ICU_INCLUDE_DIR)
|
|
||||||
set_target_properties(${_ICU_imported_target} PROPERTIES
|
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${ICU_INCLUDE_DIR}")
|
|
||||||
endif()
|
|
||||||
if(EXISTS "${${_ICU_component_cache}}")
|
|
||||||
set_target_properties(${_ICU_imported_target} PROPERTIES
|
|
||||||
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
|
|
||||||
IMPORTED_LOCATION "${${_ICU_component_cache}}")
|
|
||||||
endif()
|
|
||||||
if(EXISTS "${${_ICU_component_cache_release}}")
|
|
||||||
set_property(TARGET ${_ICU_imported_target} APPEND PROPERTY
|
|
||||||
IMPORTED_CONFIGURATIONS RELEASE)
|
|
||||||
set_target_properties(${_ICU_imported_target} PROPERTIES
|
|
||||||
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
|
|
||||||
IMPORTED_LOCATION_RELEASE "${${_ICU_component_cache_release}}")
|
|
||||||
endif()
|
|
||||||
if(EXISTS "${${_ICU_component_cache_debug}}")
|
|
||||||
set_property(TARGET ${_ICU_imported_target} APPEND PROPERTY
|
|
||||||
IMPORTED_CONFIGURATIONS DEBUG)
|
|
||||||
set_target_properties(${_ICU_imported_target} PROPERTIES
|
|
||||||
IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
|
|
||||||
IMPORTED_LOCATION_DEBUG "${${_ICU_component_cache_debug}}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
unset(_ICU_component_upcase)
|
|
||||||
unset(_ICU_component_cache)
|
|
||||||
unset(_ICU_component_lib)
|
|
||||||
unset(_ICU_component_found)
|
|
||||||
unset(_ICU_imported_target)
|
|
||||||
endforeach()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ICU_DEBUG)
|
|
||||||
message(STATUS "--------FindICU.cmake results debug--------")
|
|
||||||
message(STATUS "ICU found: ${ICU_FOUND}")
|
|
||||||
message(STATUS "ICU_VERSION number: ${ICU_VERSION}")
|
|
||||||
message(STATUS "ICU_ROOT directory: ${ICU_ROOT}")
|
|
||||||
message(STATUS "ICU_INCLUDE_DIR directory: ${ICU_INCLUDE_DIR}")
|
|
||||||
message(STATUS "ICU_LIBRARIES: ${ICU_LIBRARIES}")
|
|
||||||
|
|
||||||
foreach(program IN LISTS icu_programs)
|
|
||||||
string(TOUPPER "${program}" program_upcase)
|
|
||||||
set(program_lib "ICU_${program_upcase}_EXECUTABLE")
|
|
||||||
message(STATUS "${program} program: ${${program_lib}}")
|
|
||||||
unset(program_upcase)
|
|
||||||
unset(program_lib)
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
foreach(component IN LISTS ICU_FIND_COMPONENTS)
|
|
||||||
string(TOUPPER "${component}" component_upcase)
|
|
||||||
set(component_lib "ICU_${component_upcase}_LIBRARIES")
|
|
||||||
set(component_found "${component_upcase}_FOUND")
|
|
||||||
message(STATUS "${component} library found: ${${component_found}}")
|
|
||||||
message(STATUS "${component} library: ${${component_lib}}")
|
|
||||||
unset(component_upcase)
|
|
||||||
unset(component_lib)
|
|
||||||
unset(component_found)
|
|
||||||
endforeach()
|
|
||||||
message(STATUS "----------------")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
unset(icu_programs)
|
|
|
@ -90,4 +90,6 @@ write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ServerConfi
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ServerConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ServerConfigVersion.cmake
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ServerConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ServerConfigVersion.cmake
|
||||||
DESTINATION ${FREERDP_SERVER_CMAKE_INSTALL_DIR})
|
DESTINATION ${FREERDP_SERVER_CMAKE_INSTALL_DIR})
|
||||||
|
|
||||||
install(EXPORT FreeRDP-ServerTargets DESTINATION ${FREERDP_SERVER_CMAKE_INSTALL_DIR})
|
if (CMAKE_BUILD_SHARED)
|
||||||
|
install(EXPORT FreeRDP-ServerTargets DESTINATION ${FREERDP_SERVER_CMAKE_INSTALL_DIR})
|
||||||
|
endif()
|
||||||
|
|
|
@ -74,4 +74,3 @@ if (WITH_DEBUG_SYMBOLS AND MSVC AND BUILD_SHARED_LIBS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/Common")
|
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/Common")
|
||||||
export_complex_library(LIBNAME ${MODULE_NAME})
|
|
||||||
|
|
|
@ -96,7 +96,9 @@ write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ProxyConfig
|
||||||
|
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ProxyConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ProxyConfigVersion.cmake
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ProxyConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ProxyConfigVersion.cmake
|
||||||
DESTINATION ${FREERDP_PROXY_CMAKE_INSTALL_DIR})
|
DESTINATION ${FREERDP_PROXY_CMAKE_INSTALL_DIR})
|
||||||
install(EXPORT FreeRDP-ProxyTargets DESTINATION ${FREERDP_PROXY_CMAKE_INSTALL_DIR})
|
if (CMAKE_BUILD_SHARED)
|
||||||
|
install(EXPORT FreeRDP-ProxyTargets DESTINATION ${FREERDP_PROXY_CMAKE_INSTALL_DIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/proxy")
|
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/proxy")
|
||||||
|
|
||||||
|
|
|
@ -377,4 +377,6 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ShadowConfig.cmake
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ShadowConfigVersion.cmake
|
${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ShadowConfigVersion.cmake
|
||||||
DESTINATION ${FREERDP_SERVER_CMAKE_INSTALL_DIR})
|
DESTINATION ${FREERDP_SERVER_CMAKE_INSTALL_DIR})
|
||||||
|
|
||||||
install(EXPORT FreeRDP-ShadowTargets DESTINATION ${FREERDP_SERVER_CMAKE_INSTALL_DIR})
|
if (CMAKE_BUILD_SHARED)
|
||||||
|
install(EXPORT FreeRDP-ShadowTargets DESTINATION ${FREERDP_SERVER_CMAKE_INSTALL_DIR})
|
||||||
|
endif()
|
||||||
|
|
|
@ -107,7 +107,6 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/)
|
||||||
# Check for cmake compatibility (enable/disable features)
|
# Check for cmake compatibility (enable/disable features)
|
||||||
include(CheckCmakeCompat)
|
include(CheckCmakeCompat)
|
||||||
include(FindFeature)
|
include(FindFeature)
|
||||||
include(ComplexLibrary)
|
|
||||||
include(FeatureSummary)
|
include(FeatureSummary)
|
||||||
include(CheckCCompilerFlag)
|
include(CheckCCompilerFlag)
|
||||||
include(GNUInstallDirsWrapper)
|
include(GNUInstallDirsWrapper)
|
||||||
|
|
Loading…
Reference in New Issue