Milestone 5: deliver embedded RDP sessions and lifecycle hardening
This commit is contained in:
15
third_party/FreeRDP/cmake/AddFuzzerTest.cmake
vendored
Normal file
15
third_party/FreeRDP/cmake/AddFuzzerTest.cmake
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
macro(add_fuzzer_test FILES LINK_LIBS)
|
||||
if(BUILD_FUZZERS)
|
||||
string(REPLACE " " ";" LOCAL_LINK_LIBS ${LINK_LIBS})
|
||||
list(APPEND LOCAL_LINK_LIBS fuzzer_config)
|
||||
foreach(test ${FILES})
|
||||
get_filename_component(TestName ${test} NAME_WE)
|
||||
add_executable(${TestName} ${test})
|
||||
# Use PUBLIC to force 'fuzzer_config' for all dependent targets.
|
||||
target_link_libraries(${TestName} PUBLIC ${LOCAL_LINK_LIBS})
|
||||
add_test(${TestName} ${TESTING_OUTPUT_DIRECTORY}/${MODULE_NAME} ${TestName})
|
||||
set_target_properties(${TestName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}")
|
||||
add_dependencies(fuzzers ${TestName})
|
||||
endforeach()
|
||||
endif(BUILD_FUZZERS)
|
||||
endmacro()
|
||||
94
third_party/FreeRDP/cmake/AddTargetWithResourceFile.cmake
vendored
Normal file
94
third_party/FreeRDP/cmake/AddTargetWithResourceFile.cmake
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
set(add_resource_macro_internal_dir ${CMAKE_CURRENT_LIST_DIR} CACHE INTERNAL "")
|
||||
|
||||
include(CleaningConfigureFile)
|
||||
|
||||
macro(AddTargetWithResourceFile nameAndTarget is_exe version sources)
|
||||
list(LENGTH ${nameAndTarget} target_length)
|
||||
if(target_length GREATER 1)
|
||||
list(GET ${nameAndTarget} 1 name)
|
||||
list(GET ${nameAndTarget} 0 target)
|
||||
else()
|
||||
set(name ${nameAndTarget})
|
||||
set(target ${nameAndTarget})
|
||||
endif()
|
||||
|
||||
set(VERSIONING OFF)
|
||||
set(IS_EXE OFF)
|
||||
if("${is_exe}" MATCHES "TRUE")
|
||||
set(IS_EXE ON)
|
||||
elseif("${is_exe}" MATCHES "WIN32")
|
||||
set(IS_EXE ON)
|
||||
set(exe_options "WIN32")
|
||||
elseif("${is_exe}" MATCHES "SHARED")
|
||||
set(lib_options "SHARED")
|
||||
elseif("${is_exe}" MATCHES "STATIC")
|
||||
set(lib_options "STATIC")
|
||||
endif()
|
||||
|
||||
if(IS_EXE AND WITH_BINARY_VERSIONING)
|
||||
set(VERSIONING ON)
|
||||
elseif(NOT IS_EXE AND (WITH_LIBRARY_VERSIONING OR WITH_LIBRARY_SOVERSIONING))
|
||||
set(VERSIONING ON)
|
||||
endif()
|
||||
if(${ARGC} GREATER 4)
|
||||
set(VERSIONING ${ARGV5})
|
||||
endif()
|
||||
|
||||
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+).*" RC_PROGRAM_VERSION_MATCH ${version})
|
||||
set(RC_VERSION_MAJOR ${CMAKE_MATCH_1})
|
||||
set(RC_VERSION_MINOR ${CMAKE_MATCH_2})
|
||||
set(RC_VERSION_BUILD ${CMAKE_MATCH_3})
|
||||
|
||||
if(WIN32)
|
||||
if(IS_EXE)
|
||||
if(VERSIONING)
|
||||
set(RC_VERSION_FILE "${name}${RC_VERSION_MAJOR}${CMAKE_EXECUTABLE_SUFFIX}")
|
||||
else()
|
||||
set(RC_VERSION_FILE "${name}${CMAKE_EXECUTABLE_SUFFIX}")
|
||||
endif()
|
||||
else()
|
||||
if(VERSIONING AND WITH_LIBRARY_VERSIONING)
|
||||
set(RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${name}${RC_VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
else()
|
||||
set(RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${name}${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
cleaning_configure_file(
|
||||
${add_resource_macro_internal_dir}/WindowsDLLVersion.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY
|
||||
)
|
||||
|
||||
list(APPEND ${sources} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
|
||||
endif()
|
||||
|
||||
set(OUTPUT_FILENAME "${name}")
|
||||
if(VERSIONING)
|
||||
string(APPEND OUTPUT_FILENAME "${RC_VERSION_MAJOR}")
|
||||
endif()
|
||||
|
||||
if(IS_EXE)
|
||||
message("add_executable(${target}) [${exe_options}]")
|
||||
add_executable(${target} ${exe_options} ${${sources}})
|
||||
|
||||
set_target_properties(${target} PROPERTIES OUTPUT_NAME ${OUTPUT_FILENAME})
|
||||
string(APPEND OUTPUT_FILENAME "${CMAKE_EXECUTABLE_SUFFIX}")
|
||||
else()
|
||||
message("add_library(${target}) [${lib_options}]")
|
||||
add_library(${target} ${lib_options} ${${sources}})
|
||||
|
||||
if(VERSIONING AND WITH_LIBRARY_SOVERSIONING)
|
||||
set_target_properties(${target} PROPERTIES VERSION ${version} SOVERSION ${RC_VERSION_MAJOR})
|
||||
endif()
|
||||
|
||||
if(VERSIONING AND WITH_LIBRARY_VERSIONING)
|
||||
set_target_properties(${target} PROPERTIES OUTPUT_NAME ${OUTPUT_FILENAME})
|
||||
set(OUTPUT_FILENAME "${CMAKE_SHARED_LIBRARY_PREFIX}${OUTPUT_FILENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_DEBUG_SYMBOLS AND MSVC AND (is_exe OR BUILD_SHARED_LIBS))
|
||||
message("add PDB for ${OUTPUT_FILENAME}")
|
||||
set_target_properties(${target} PROPERTIES PDB_NAME ${OUTPUT_FILENAME})
|
||||
install(FILES $<TARGET_PDB_FILE:${target}> DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT symbols)
|
||||
endif()
|
||||
endmacro()
|
||||
12
third_party/FreeRDP/cmake/CFlagsToVar.cmake
vendored
Normal file
12
third_party/FreeRDP/cmake/CFlagsToVar.cmake
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
function(CFlagsToVar NAME CFG)
|
||||
string(TOUPPER "${CFG}" UCFG)
|
||||
set(C_FLAGS ${CMAKE_C_FLAGS})
|
||||
string(REPLACE "${CMAKE_SOURCE_DIR}" "<src dir>" C_FLAGS "${C_FLAGS}")
|
||||
string(REPLACE "${CMAKE_BINARY_DIR}" "<build dir>" C_FLAGS "${C_FLAGS}")
|
||||
|
||||
string(APPEND C_FLAGS " ${CMAKE_C_FLAGS_${UCFG}}")
|
||||
|
||||
string(REPLACE "\$" "\\\$" C_FLAGS "${C_FLAGS}")
|
||||
string(REPLACE "\"" "\\\"" C_FLAGS "${C_FLAGS}")
|
||||
set(${NAME} ${C_FLAGS} PARENT_SCOPE)
|
||||
endfunction()
|
||||
59
third_party/FreeRDP/cmake/CXXCompilerFlags.cmake
vendored
Normal file
59
third_party/FreeRDP/cmake/CXXCompilerFlags.cmake
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
include(CheckCXXCompilerFlag)
|
||||
include(CommonCompilerFlags)
|
||||
|
||||
macro(checkCXXFlag FLAG)
|
||||
check_cxx_compiler_flag("${FLAG}" CXXFLAG${FLAG})
|
||||
if(CXXFLAG${FLAG})
|
||||
string(APPEND CMAKE_CXX_FLAGS " ${FLAG}")
|
||||
else()
|
||||
message(WARNING "compiler does not support ${FLAG}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
if(ENABLE_WARNING_VERBOSE)
|
||||
if(MSVC)
|
||||
# Remove previous warning definitions,
|
||||
# NMake is otherwise complaining.
|
||||
foreach(flags_var_to_scrub CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
|
||||
CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_MINSIZEREL
|
||||
)
|
||||
string(REGEX REPLACE "(^| )[/-]W[ ]*[1-9]" " " "${flags_var_to_scrub}" "${${flags_var_to_scrub}}")
|
||||
endforeach()
|
||||
else()
|
||||
list(
|
||||
APPEND
|
||||
COMMON_COMPILER_FLAGS
|
||||
-Wno-declaration-after-statement
|
||||
-Wno-ctad-maybe-unsupported
|
||||
-Wno-c++98-compat
|
||||
-Wno-c++98-compat-pedantic
|
||||
-Wno-pre-c++17-compat
|
||||
-Wno-exit-time-destructors
|
||||
-Wno-gnu-zero-variadic-macro-arguments
|
||||
-Wno-nrvo
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
foreach(FLAG ${COMMON_COMPILER_FLAGS})
|
||||
checkcxxflag(${FLAG})
|
||||
endforeach()
|
||||
|
||||
# https://stackoverflow.com/questions/4913922/possible-problems-with-nominmax-on-visual-c
|
||||
if(WIN32)
|
||||
add_compile_definitions($<$<COMPILE_LANGUAGE:CXX>:NOMINMAX>)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
add_compile_options(/Gd)
|
||||
|
||||
add_compile_options("$<$<CONFIG:Debug>:/Zi>")
|
||||
add_compile_definitions(_CRT_NONSTDC_NO_DEPRECATE)
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "default CXXFLAGS")
|
||||
message("Using CXXFLAGS ${CMAKE_CXX_FLAGS}")
|
||||
message("Using CXXFLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
message("Using CXXFLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}")
|
||||
message("Using CXXFLAGS_MINSIZEREL ${CMAKE_CXX_FLAGS_MINSIZEREL}")
|
||||
message("Using CXXFLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
|
||||
31
third_party/FreeRDP/cmake/CheckAndSetFlag.cmake
vendored
Normal file
31
third_party/FreeRDP/cmake/CheckAndSetFlag.cmake
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
include(CheckCCompilerFlag)
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
macro(RemoveFlag FLAG)
|
||||
string(REPLACE "${FLAG}" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||
string(REPLACE "${FLAG}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
endmacro()
|
||||
|
||||
macro(CheckAndSetFlag FLAG)
|
||||
get_property(languages GLOBAL PROPERTY ENABLED_LANGUAGES)
|
||||
|
||||
unset(C_FLAG)
|
||||
unset(CXX_FLAG)
|
||||
if("C" IN_LIST languages)
|
||||
check_c_compiler_flag("${FLAG}" C_FLAG)
|
||||
if(C_FLAG)
|
||||
string(APPEND CMAKE_C_FLAGS " ${FLAG}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if("CXX" IN_LIST languages)
|
||||
check_cxx_compiler_flag("${FLAG}" CXX_FLAG)
|
||||
if(CXX_FLAG)
|
||||
string(APPEND CMAKE_CXX_FLAGS " ${FLAG}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT C_FLAG AND NOT CXX_FLAG)
|
||||
message(WARNING "compiler does not support ${FLAG}")
|
||||
endif()
|
||||
endmacro()
|
||||
26
third_party/FreeRDP/cmake/CheckCmakeCompat.cmake
vendored
Normal file
26
third_party/FreeRDP/cmake/CheckCmakeCompat.cmake
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
# Central location to check for cmake (version) requirements
|
||||
#
|
||||
#=============================================================================
|
||||
# Copyright 2012 Bernhard Miklautz <bernhard.miklautz@thincast.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.
|
||||
#=============================================================================
|
||||
|
||||
macro(enable_cmake_compat CMVERSION)
|
||||
if(${CMAKE_VERSION} VERSION_LESS ${CMVERSION})
|
||||
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/compat_${CMVERSION}/")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Compatibility includes - order does matter!
|
||||
enable_cmake_compat(3.7.0)
|
||||
42
third_party/FreeRDP/cmake/ClangDetectTool.cmake
vendored
Normal file
42
third_party/FreeRDP/cmake/ClangDetectTool.cmake
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
function(clang_detect_tool VAR NAME OPTS)
|
||||
set(NAMES "")
|
||||
foreach(CNT RANGE 12 22)
|
||||
list(APPEND NAMES "${NAME}-${CNT}")
|
||||
endforeach()
|
||||
list(REVERSE NAMES)
|
||||
list(APPEND NAMES ${NAME})
|
||||
|
||||
find_program(${VAR} NAMES ${NAMES} ${OPTS})
|
||||
if(NOT ${VAR})
|
||||
message(WARNING "clang tool ${NAME} (${VAR}) not detected, skipping")
|
||||
unset(${VAR})
|
||||
return()
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${${VAR}} "--version" OUTPUT_VARIABLE _CLANG_TOOL_VERSION RESULT_VARIABLE _CLANG_TOOL_VERSION_FAILED
|
||||
)
|
||||
|
||||
if(_CLANG_TOOL_VERSION_FAILED)
|
||||
message(WARNING "A problem was encountered with ${${VAR}}")
|
||||
message(WARNING "${_CLANG_TOOL_VERSION_FAILED}")
|
||||
unset(${VAR})
|
||||
return()
|
||||
endif()
|
||||
|
||||
string(REGEX MATCH "([7-9]|[1-9][0-9])\\.[0-9]\\.[0-9]" CLANG_TOOL_VERSION "${_CLANG_TOOL_VERSION}")
|
||||
|
||||
if(NOT CLANG_TOOL_VERSION)
|
||||
message(WARNING "problem parsing ${NAME} version for ${${VAR}}")
|
||||
unset(${VAR})
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(_CLANG_TOOL_MINIMUM_VERSION "12.0.0")
|
||||
if(${CLANG_TOOL_VERSION} VERSION_LESS ${_CLANG_TOOL_MINIMUM_VERSION})
|
||||
message(WARNING "clang-format version ${CLANG_TOOL_VERSION} not supported")
|
||||
message(WARNING "Minimum version required: ${_CLANG_TOOL_MINIMUM_VERSION}")
|
||||
unset(${VAR})
|
||||
return()
|
||||
endif()
|
||||
endfunction()
|
||||
19
third_party/FreeRDP/cmake/ClangFormat.cmake
vendored
Normal file
19
third_party/FreeRDP/cmake/ClangFormat.cmake
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# get all project files
|
||||
file(
|
||||
GLOB_RECURSE
|
||||
ALL_SOURCE_FILES
|
||||
*.cpp
|
||||
*.c
|
||||
*.h
|
||||
*.m
|
||||
*.java
|
||||
)
|
||||
|
||||
include(ClangDetectTool)
|
||||
clang_detect_tool(CLANG_FORMAT clang-format "")
|
||||
|
||||
if(NOT CLANG_FORMAT)
|
||||
message(WARNING "clang-format not found in path! code format target not available.")
|
||||
else()
|
||||
add_custom_target(clangformat COMMAND ${CLANG_FORMAT} -style=file -i ${ALL_SOURCE_FILES})
|
||||
endif()
|
||||
16
third_party/FreeRDP/cmake/ClangTidy.cmake
vendored
Normal file
16
third_party/FreeRDP/cmake/ClangTidy.cmake
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
option(BUILD_WITH_CLANG_TIDY "Build with clang-tidy for extra warnings" OFF)
|
||||
|
||||
if(BUILD_WITH_CLANG_TIDY)
|
||||
include(ClangDetectTool)
|
||||
clang_detect_tool(CLANG_TIDY_EXE clang-tidy REQUIRED)
|
||||
|
||||
set(CLANG_TIDY_COMMAND ${CLANG_TIDY_EXE})
|
||||
|
||||
set(CMAKE_C_CLANG_TIDY "${CLANG_TIDY_COMMAND}")
|
||||
set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}")
|
||||
set(CMAKE_OBJC_CLANG_TIDY "${CLANG_TIDY_COMMAND}")
|
||||
else()
|
||||
unset(CMAKE_C_CLANG_TIDY)
|
||||
unset(CMAKE_CXX_CLANG_TIDY)
|
||||
unset(CMAKE_OBJC_CLANG_TIDY)
|
||||
endif()
|
||||
19
third_party/FreeRDP/cmake/ClangToolchain.cmake
vendored
Normal file
19
third_party/FreeRDP/cmake/ClangToolchain.cmake
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
if($ENV{CLANG_VERSION})
|
||||
set(CLANG_VERSION "-$ENV{CLANG_VERSION}")
|
||||
endif()
|
||||
|
||||
set(CLANG_WARNINGS
|
||||
"-pedantic -Weverything -Wno-padded -Wno-covered-switch-default -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-cast-align"
|
||||
)
|
||||
|
||||
set(CMAKE_C_COMPILER "/usr/bin/clang${CLANG_VERSION}" CACHE PATH "")
|
||||
set(CMAKE_C_FLAGS ${CLANG_WARNINGS} CACHE STRING "")
|
||||
|
||||
set(CMAKE_CXX_COMPILER "/usr/bin/clang++${CLANG_VERSION}" CACHE PATH "")
|
||||
set(CMAKE_CXX_FLAGS ${CLANG_WARNINGS} CACHE STRING "")
|
||||
|
||||
set(CMAKE_AR "/usr/bin/llvm-ar${CLANG_VERSION}" CACHE PATH "")
|
||||
set(CMAKE_LINKER "/usr/bin/llvm-link${CLANG_VERSION}" CACHE PATH "")
|
||||
set(CMAKE_NM "/usr/bin/llvm-nm${CLANG_VERSION}" CACHE PATH "")
|
||||
set(CMAKE_OBJDUMP "/usr/bin/llvm-objdump${CLANG_VERSION}" CACHE PATH "")
|
||||
set(CMAKE_RANLIB "/usr/bin/llvm-ranlib${CLANG_VERSION}" CACHE PATH "")
|
||||
70
third_party/FreeRDP/cmake/CleaningConfigureFile.cmake
vendored
Normal file
70
third_party/FreeRDP/cmake/CleaningConfigureFile.cmake
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
# Little helper that adds the generated file to the
|
||||
# files to be cleaned in the current directory.
|
||||
#
|
||||
# Handy if the generated files might have changed
|
||||
#
|
||||
|
||||
include(CFlagsToVar)
|
||||
|
||||
function(cleaning_configure_file RSRC RDST)
|
||||
get_filename_component(SRC "${RSRC}" ABSOLUTE BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
get_filename_component(DST "${RDST}" ABSOLUTE BASE_DIR ${CMAKE_CURRENT_BINARY_DIR})
|
||||
get_filename_component(DST_DIR "${DST}" DIRECTORY)
|
||||
get_filename_component(DST_NAME ${DST} NAME)
|
||||
|
||||
# ensure the temporary configuration files are in a different directory
|
||||
set(CFG_DIR "${CMAKE_CURRENT_BINARY_DIR}/cfg")
|
||||
file(MAKE_DIRECTORY "${CFG_DIR}")
|
||||
|
||||
# Generate the temporary configuration files
|
||||
if(CMAKE_CONFIGURATION_TYPES)
|
||||
foreach(CFG ${CMAKE_CONFIGURATION_TYPES})
|
||||
set(CURRENT_BUILD_CONFIG ${CFG})
|
||||
if(NOT SOURCE_CFG_INIT)
|
||||
set(SOURCE_CFG_INIT "${CFG_DIR}/${DST_NAME}_${CFG}")
|
||||
endif()
|
||||
cflagstovar(CURRENT_C_FLAGS ${CURRENT_BUILD_CONFIG})
|
||||
configure_file(${SRC} "${CFG_DIR}/${DST_NAME}_${CFG}" ${ARGN})
|
||||
unset(CURRENT_BUILD_CONFIG)
|
||||
unset(CURRENT_C_FLAGS)
|
||||
endforeach()
|
||||
set(SOURCE_CFG "${CFG_DIR}/${DST_NAME}_$<CONFIG>")
|
||||
else()
|
||||
# We call this also from CMake scripts without a CMAKE_BUILD_TYPE
|
||||
# Fall back to an explicitly unsupported build type to point out something is wrong
|
||||
# if this variable is used during such a call
|
||||
if(CMAKE_BUILD_TYPE)
|
||||
set(CURRENT_BUILD_CONFIG ${CMAKE_BUILD_TYPE})
|
||||
else()
|
||||
set(CURRENT_BUILD_CONFIG "InvalidBuildType")
|
||||
endif()
|
||||
cflagstovar(CURRENT_C_FLAGS ${CURRENT_BUILD_CONFIG})
|
||||
set(SOURCE_CFG "${CFG_DIR}/${DST_NAME}_${CMAKE_BUILD_TYPE}")
|
||||
set(SOURCE_CFG_INIT "${SOURCE_CFG}")
|
||||
configure_file(${SRC} "${SOURCE_CFG}" ${ARGN})
|
||||
unset(CURRENT_BUILD_CONFIG)
|
||||
unset(CURRENT_C_FLAGS)
|
||||
endif()
|
||||
|
||||
# Fallback for older CMake: we want to copy only if the destination is different.
|
||||
# First do an initial copy during configuration
|
||||
file(MAKE_DIRECTORY "${DST_DIR}")
|
||||
if(CMAKE_VERSION VERSION_LESS "3.21.0")
|
||||
get_filename_component(CFG_VAR ${SOURCE_CFG_INIT} NAME)
|
||||
file(COPY ${SOURCE_CFG_INIT} DESTINATION ${DST_DIR})
|
||||
set(CFG_VAR_ABS "${DST_DIR}/${CFG_VAR}")
|
||||
file(RENAME ${CFG_VAR_ABS} ${DST})
|
||||
else()
|
||||
file(COPY_FILE ${SOURCE_CFG_INIT} ${DST} ONLY_IF_DIFFERENT)
|
||||
endif()
|
||||
|
||||
# Create a target to recreate the configuration file if something changes.
|
||||
string(SHA256 DST_HASH "${DST}")
|
||||
string(SUBSTRING "${DST_HASH}" 0 8 DST_HASH)
|
||||
if(NOT TARGET ct-${DST_HASH})
|
||||
add_custom_target(
|
||||
ct-${DST_HASH} COMMAND ${CMAKE_COMMAND} "-E" "make_directory" "${DST_DIR}"
|
||||
COMMAND ${CMAKE_COMMAND} "-E" "copy_if_different" "${SOURCE_CFG}" "${DST}" DEPENDS ${SOURCE_CFG} ${DST}
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
49
third_party/FreeRDP/cmake/CommonCompilerFlags.cmake
vendored
Normal file
49
third_party/FreeRDP/cmake/CommonCompilerFlags.cmake
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
include(CheckAndSetFlag)
|
||||
|
||||
option(ENABLE_WARNING_VERBOSE "enable -Weveryting (and some exceptions) for compile" OFF)
|
||||
option(ENABLE_WARNING_ERROR "enable -Werror for compile" OFF)
|
||||
|
||||
set(COMMON_COMPILER_FLAGS "")
|
||||
if(ENABLE_WARNING_VERBOSE)
|
||||
if(MSVC)
|
||||
list(APPEND COMMON_COMPILER_FLAGS /W4 /wo4324)
|
||||
else()
|
||||
list(
|
||||
APPEND
|
||||
COMMON_COMPILER_FLAGS
|
||||
-Weverything
|
||||
-Wall
|
||||
-Wpedantic
|
||||
-Wno-padded
|
||||
-Wno-switch-enum
|
||||
-Wno-cast-align
|
||||
-Wno-unsafe-buffer-usage
|
||||
-Wno-reserved-identifier
|
||||
-Wno-covered-switch-default
|
||||
-Wno-disabled-macro-expansion
|
||||
-Wno-used-but-marked-unused
|
||||
-Wno-implicit-void-ptr-cast
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ENABLE_WARNING_ERROR)
|
||||
list(APPEND COMMON_COMPILER_FLAGS -Werror)
|
||||
endif()
|
||||
|
||||
list(APPEND COMMON_COMPILER_FLAGS -fno-omit-frame-pointer -Wredundant-decls)
|
||||
list(APPEND COMMON_COMPILER_FLAGS -fsigned-char)
|
||||
|
||||
include(ExportAllSymbols)
|
||||
include(CompilerSanitizerOptions)
|
||||
|
||||
if(CMAKE_C_COMPILER_ID MATCHES ".*Clang.*" OR (CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_C_COMPILER_VERSION
|
||||
VERSION_GREATER_EQUAL 10)
|
||||
)
|
||||
add_compile_options($<$<NOT:$<CONFIG:Debug>>:-fdebug-prefix-map=${CMAKE_SOURCE_DIR}=.>)
|
||||
add_compile_options($<$<NOT:$<CONFIG:Debug>>:-fmacro-prefix-map=${CMAKE_SOURCE_DIR}=.>)
|
||||
add_compile_options($<$<NOT:$<CONFIG:Debug>>:-ffile-prefix-map=${CMAKE_SOURCE_DIR}=.>)
|
||||
add_compile_options($<$<NOT:$<CONFIG:Debug>>:-fdebug-prefix-map=${CMAKE_BINARY_DIR}=./build>)
|
||||
add_compile_options($<$<NOT:$<CONFIG:Debug>>:-fmacro-prefix-map=${CMAKE_BINARY_DIR}=./build>)
|
||||
add_compile_options($<$<NOT:$<CONFIG:Debug>>:-ffile-prefix-map=${CMAKE_BINARY_DIR}=./build>)
|
||||
endif()
|
||||
66
third_party/FreeRDP/cmake/CommonConfigOptions.cmake
vendored
Normal file
66
third_party/FreeRDP/cmake/CommonConfigOptions.cmake
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
option(CMAKE_COLOR_MAKEFILE "colorful CMake makefile" ON)
|
||||
option(CMAKE_VERBOSE_MAKEFILE "verbose CMake makefile" ON)
|
||||
option(CMAKE_POSITION_INDEPENDENT_CODE "build with position independent code (-fPIC or -fPIE)" ON)
|
||||
option(WITH_LIBRARY_VERSIONING "Append library major version to name" ON)
|
||||
option(WITH_LIBRARY_SOVERSIONING "Use library SO version triplet" ON)
|
||||
option(WITH_BINARY_VERSIONING "Use binary versioning" OFF)
|
||||
option(WITH_RESOURCE_VERSIONING "Use resource versioning" OFF)
|
||||
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
|
||||
|
||||
if(CMAKE_EXPORT_COMPILE_COMMANDS STREQUAL "")
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE BOOL "project default" FORCE)
|
||||
endif()
|
||||
|
||||
# We want to control the winpr assert for the whole project
|
||||
option(WITH_VERBOSE_WINPR_ASSERT "Compile with verbose WINPR_ASSERT." ON)
|
||||
if(WITH_VERBOSE_WINPR_ASSERT)
|
||||
add_compile_definitions(WITH_VERBOSE_WINPR_ASSERT)
|
||||
endif()
|
||||
|
||||
# known issue on android, thus disabled until we support newer CMake
|
||||
# https://github.com/android/ndk/issues/1444
|
||||
if(NOT ANDROID OR ("${CMAKE_VERSION}" GREATER_EQUAL "3.20.0"))
|
||||
if(POLICY CMP0138)
|
||||
cmake_policy(SET CMP0138 NEW)
|
||||
endif()
|
||||
include(CheckIPOSupported)
|
||||
check_ipo_supported(RESULT supported OUTPUT error)
|
||||
if(NOT supported)
|
||||
message(WARNING "LTO not supported, got ${error}")
|
||||
endif()
|
||||
|
||||
option(CMAKE_INTERPROCEDURAL_OPTIMIZATION "build with link time optimization" ${supported})
|
||||
endif()
|
||||
|
||||
set(SUPPORTED_BUILD_TYPES "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
||||
|
||||
# Default to release build type
|
||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
# Set a default build type if none was specified
|
||||
set(default_build_type "Release")
|
||||
|
||||
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
|
||||
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE)
|
||||
# Set the possible values of build type for cmake-gui
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${SUPPORTED_BUILD_TYPES})
|
||||
endif()
|
||||
|
||||
if(CMAKE_BUILD_TYPE)
|
||||
if(NOT "${CMAKE_BUILD_TYPE}" IN_LIST SUPPORTED_BUILD_TYPES)
|
||||
message(FATAL_ERROR "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} not supported. Set to any of ${SUPPORTED_BUILD_TYPES}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_CONFIGURATION_TYPES)
|
||||
set(CMAKE_CONFIGURATION_TYPES "Release;Debug;MinSizeRel;RelWithDebInfo" CACHE INTERNAL "freerdp default")
|
||||
endif()
|
||||
|
||||
include(PlatformDefaults)
|
||||
include(PreventInSourceBuilds)
|
||||
include(GNUInstallDirsWrapper)
|
||||
include(MSVCRuntime)
|
||||
include(ConfigureRPATH)
|
||||
include(ClangTidy)
|
||||
include(AddTargetWithResourceFile)
|
||||
include(DisableCompilerWarnings)
|
||||
include(CleaningConfigureFile)
|
||||
3
third_party/FreeRDP/cmake/CompilerDetect.cmake
vendored
Normal file
3
third_party/FreeRDP/cmake/CompilerDetect.cmake
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
if(CMAKE_C_COMPILER_ID MATCHES ".*Clang.*" OR CMAKE_CXX_COMPILER_ID MATCHES ".*Clang.*")
|
||||
set(CMAKE_COMPILER_IS_CLANG 1)
|
||||
endif()
|
||||
53
third_party/FreeRDP/cmake/CompilerFlags.cmake
vendored
Normal file
53
third_party/FreeRDP/cmake/CompilerFlags.cmake
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
include(CheckCCompilerFlag)
|
||||
include(CommonCompilerFlags)
|
||||
|
||||
macro(checkCFlag FLAG)
|
||||
check_c_compiler_flag("${FLAG}" CFLAG${FLAG})
|
||||
if(CFLAG${FLAG})
|
||||
string(APPEND CMAKE_C_FLAGS " ${FLAG}")
|
||||
else()
|
||||
message(WARNING "compiler does not support ${FLAG}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
if(ENABLE_WARNING_VERBOSE)
|
||||
if(MSVC)
|
||||
# Remove previous warning definitions,
|
||||
# NMake is otherwise complaining.
|
||||
foreach(flags_var_to_scrub CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO
|
||||
CMAKE_C_FLAGS_MINSIZEREL
|
||||
)
|
||||
string(REGEX REPLACE "(^| )[/-]W[ ]*[1-9]" " " "${flags_var_to_scrub}" "${${flags_var_to_scrub}}")
|
||||
endforeach()
|
||||
else()
|
||||
list(APPEND COMMON_COMPILER_FLAGS -Wno-declaration-after-statement -Wno-pre-c11-compat
|
||||
-Wno-gnu-zero-variadic-macro-arguments
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
list(APPEND COMMON_COMPILER_FLAGS -Wimplicit-function-declaration -Wno-jump-misses-init -Wno-c++-keyword)
|
||||
|
||||
foreach(FLAG ${COMMON_COMPILER_FLAGS})
|
||||
checkcflag(${FLAG})
|
||||
endforeach()
|
||||
|
||||
# Android profiling
|
||||
if(ANDROID)
|
||||
if(WITH_GPROF)
|
||||
checkandsetflag(-pg)
|
||||
set(PROFILER_LIBRARIES "${FREERDP_EXTERNAL_PROFILER_PATH}/obj/local/${ANDROID_ABI}/libandroid-ndk-profiler.a")
|
||||
include_directories(SYSTEM "${FREERDP_EXTERNAL_PROFILER_PATH}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Assume source files are utf-8 when compiling with MSVC
|
||||
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
|
||||
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
|
||||
|
||||
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "default CFLAGS")
|
||||
message("Using CFLAGS ${CMAKE_C_FLAGS}")
|
||||
message("Using CFLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}")
|
||||
message("Using CFLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}")
|
||||
message("Using CFLAGS_MINSIZEREL ${CMAKE_C_FLAGS_MINSIZEREL}")
|
||||
message("Using CFLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
||||
49
third_party/FreeRDP/cmake/CompilerSanitizerOptions.cmake
vendored
Normal file
49
third_party/FreeRDP/cmake/CompilerSanitizerOptions.cmake
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
include(CMakeDependentOption)
|
||||
include(CheckIncludeFiles)
|
||||
|
||||
cmake_dependent_option(
|
||||
WITH_VALGRIND_MEMCHECK "Compile with valgrind helpers." OFF
|
||||
"NOT WITH_SANITIZE_ADDRESS; NOT WITH_SANITIZE_MEMORY; NOT WITH_SANITIZE_THREAD" OFF
|
||||
)
|
||||
cmake_dependent_option(
|
||||
WITH_SANITIZE_ADDRESS "Compile with gcc/clang address sanitizer." OFF
|
||||
"NOT WITH_VALGRIND_MEMCHECK; NOT WITH_SANITIZE_MEMORY; NOT WITH_SANITIZE_THREAD" OFF
|
||||
)
|
||||
cmake_dependent_option(
|
||||
WITH_SANITIZE_MEMORY "Compile with gcc/clang memory sanitizer." OFF
|
||||
"NOT WITH_VALGRIND_MEMCHECK; NOT WITH_SANITIZE_ADDRESS; NOT WITH_SANITIZE_THREAD" OFF
|
||||
)
|
||||
cmake_dependent_option(
|
||||
WITH_SANITIZE_THREAD "Compile with gcc/clang thread sanitizer." OFF
|
||||
"NOT WITH_VALGRIND_MEMCHECK; NOT WITH_SANITIZE_ADDRESS; NOT WITH_SANITIZE_MEMORY" OFF
|
||||
)
|
||||
|
||||
if(WITH_VALGRIND_MEMCHECK)
|
||||
check_include_files(valgrind/memcheck.h FREERDP_HAVE_VALGRIND_MEMCHECK_H)
|
||||
else()
|
||||
unset(FREERDP_HAVE_VALGRIND_MEMCHECK_H CACHE)
|
||||
endif()
|
||||
|
||||
# Enable address sanitizer, where supported and when required
|
||||
if(CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCC)
|
||||
set(CMAKE_REQUIRED_LINK_OPTIONS_SAVED ${CMAKE_REQUIRED_LINK_OPTIONS})
|
||||
file(WRITE ${PROJECT_BINARY_DIR}/foo.txt "")
|
||||
if(WITH_SANITIZE_ADDRESS)
|
||||
add_compile_options(-fsanitize=address)
|
||||
add_compile_options(-fsanitize-address-use-after-scope)
|
||||
add_link_options(-fsanitize=address)
|
||||
elseif(WITH_SANITIZE_MEMORY)
|
||||
add_compile_options(-fsanitize=memory)
|
||||
add_compile_options(-fsanitize-memory-use-after-dtor)
|
||||
add_compile_options(-fsanitize-memory-track-origins)
|
||||
add_link_options(-fsanitize=memory)
|
||||
elseif(WITH_SANITIZE_THREAD)
|
||||
add_compile_options(-fsanitize=thread)
|
||||
add_link_options(-fsanitize=thread)
|
||||
endif()
|
||||
|
||||
option(WITH_NO_UNDEFINED "Add -Wl,--no-undefined" OFF)
|
||||
if(WITH_NO_UNDEFINED)
|
||||
add_link_options(-Wl,--no-undefined)
|
||||
endif()
|
||||
endif()
|
||||
244
third_party/FreeRDP/cmake/ConfigOptions.cmake
vendored
Normal file
244
third_party/FreeRDP/cmake/ConfigOptions.cmake
vendored
Normal file
@@ -0,0 +1,244 @@
|
||||
include(CMakeDependentOption)
|
||||
|
||||
if((CMAKE_SYSTEM_PROCESSOR MATCHES "i386|i686|x86|AMD64") AND (CMAKE_SIZEOF_VOID_P EQUAL 4))
|
||||
set(TARGET_ARCH "x86")
|
||||
elseif((CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64") AND (CMAKE_SIZEOF_VOID_P EQUAL 8))
|
||||
set(TARGET_ARCH "x64")
|
||||
elseif((CMAKE_SYSTEM_PROCESSOR MATCHES "i386") AND (CMAKE_SIZEOF_VOID_P EQUAL 8) AND (APPLE))
|
||||
# Mac is weird like that.
|
||||
set(TARGET_ARCH "x64")
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm*")
|
||||
set(TARGET_ARCH "ARM")
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "sparc")
|
||||
set(TARGET_ARCH "sparc")
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "e2k")
|
||||
set(TARGET_ARCH "e2k")
|
||||
endif()
|
||||
|
||||
if(NOT OPENBSD AND NOT WIN32)
|
||||
set(MANPAGE_DEF ON)
|
||||
endif()
|
||||
option(WITH_MANPAGES "Generate manpages." ${MANPAGE_DEF})
|
||||
option(WITH_PROFILER "Compile profiler." OFF)
|
||||
option(WITH_GPROF "Compile with GProf profiler." OFF)
|
||||
|
||||
option(WITH_JPEG "Use JPEG decoding." OFF)
|
||||
|
||||
include(CompilerDetect)
|
||||
|
||||
if(WIN32)
|
||||
if(NOT UWP)
|
||||
option(WITH_MEDIA_FOUNDATION "Enable H264 media foundation decoder." OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WIN32 AND NOT UWP)
|
||||
option(WITH_WINMM "Use Windows Multimedia" ON)
|
||||
option(WITH_WIN8 "Use Windows 8 libraries" OFF)
|
||||
endif()
|
||||
|
||||
option(BUILD_BENCHMARK "Build benchmark tools (for debugging and development only)" OFF)
|
||||
option(BUILD_TESTING "Build unit tests (compatible with packaging)" OFF)
|
||||
cmake_dependent_option(
|
||||
BUILD_TESTING_INTERNAL "Build unit tests (CI only, not for packaging!)" OFF "NOT BUILD_TESTING" OFF
|
||||
)
|
||||
cmake_dependent_option(
|
||||
BUILD_TESTING_NO_H264 "Skip building h264 unit tests (no implementation during packaging)" OFF
|
||||
"BUILD_TESTING OR BUILD_TESTING_INTERNAL" OFF
|
||||
)
|
||||
cmake_dependent_option(TESTS_WTSAPI_EXTRA "Build extra WTSAPI tests (interactive)" OFF "BUILD_TESTING_INTERNAL" OFF)
|
||||
cmake_dependent_option(BUILD_COMM_TESTS "Build comm related tests (require comm port)" OFF "BUILD_TESTING_INTERNAL" OFF)
|
||||
|
||||
option(WITH_SAMPLE "Build sample code" ON)
|
||||
|
||||
option(WITH_CLIENT_COMMON "Build client common library" ON)
|
||||
cmake_dependent_option(WITH_CLIENT "Build client binaries" ON "WITH_CLIENT_COMMON" OFF)
|
||||
cmake_dependent_option(WITH_CLIENT_SDL "[experimental] Build SDL client " ON "WITH_CLIENT" OFF)
|
||||
|
||||
option(WITH_SERVER "Build server binaries" ON)
|
||||
|
||||
option(WITH_CHANNELS "Build virtual channel plugins" ON)
|
||||
|
||||
option(FREERDP_UNIFIED_BUILD "Build WinPR, uwac, RdTk and FreeRDP in one go" ON)
|
||||
|
||||
cmake_dependent_option(WITH_CLIENT_CHANNELS "Build virtual channel plugins" ON "WITH_CLIENT_COMMON;WITH_CHANNELS" OFF)
|
||||
|
||||
cmake_dependent_option(WITH_MACAUDIO "Enable OSX sound backend" ON "APPLE;NOT IOS" OFF)
|
||||
|
||||
if(WITH_SERVER AND WITH_CHANNELS)
|
||||
option(WITH_SERVER_CHANNELS "Build virtual channel plugins" ON)
|
||||
endif()
|
||||
|
||||
option(WITH_THIRD_PARTY "Build third-party components" OFF)
|
||||
|
||||
option(WITH_CLIENT_INTERFACE "Build clients as a library with an interface" OFF)
|
||||
cmake_dependent_option(
|
||||
CLIENT_INTERFACE_SHARED "Build clients as a shared library with an interface" OFF "WITH_CLIENT_INTERFACE" OFF
|
||||
)
|
||||
option(WITH_SERVER_INTERFACE "Build servers as a library with an interface" ON)
|
||||
|
||||
option(WITH_DEBUG_ALL "Print all debug messages." OFF)
|
||||
|
||||
if(WITH_DEBUG_ALL)
|
||||
message(
|
||||
WARNING
|
||||
"WITH_DEBUG_ALL=ON, the build will be slow and might leak sensitive information, do not use with release builds!"
|
||||
)
|
||||
set(DEFAULT_DEBUG_OPTION ON CACHE INTERNAL "debug default")
|
||||
else()
|
||||
set(DEFAULT_DEBUG_OPTION OFF CACHE INTERNAL "debug default")
|
||||
endif()
|
||||
|
||||
option(WITH_DEBUG_CERTIFICATE "Print certificate related debug messages." ${DEFAULT_DEBUG_OPTION})
|
||||
if(WITH_DEBUG_CERTIFICATE)
|
||||
message(
|
||||
WARNING "WITH_DEBUG_CERTIFICATE=ON, the build might leak sensitive information, do not use with release builds!"
|
||||
)
|
||||
endif()
|
||||
option(WITH_DEBUG_CAPABILITIES "Print capability negotiation debug messages." ${DEFAULT_DEBUG_OPTION})
|
||||
option(WITH_DEBUG_CHANNELS "Print channel manager debug messages." ${DEFAULT_DEBUG_OPTION})
|
||||
option(WITH_DEBUG_CLIPRDR "Print clipboard redirection debug messages" ${DEFAULT_DEBUG_OPTION})
|
||||
option(WITH_DEBUG_CODECS "Print codec debug messages" ${DEFAULT_DEBUG_OPTION})
|
||||
option(WITH_DEBUG_RDPGFX "Print RDPGFX debug messages" ${DEFAULT_DEBUG_OPTION})
|
||||
option(WITH_DEBUG_DVC "Print dynamic virtual channel debug messages." ${DEFAULT_DEBUG_OPTION})
|
||||
cmake_dependent_option(
|
||||
WITH_DEBUG_TSMF "Print TSMF virtual channel debug messages." ${DEFAULT_DEBUG_OPTION} "CHANNEL_TSMF" OFF
|
||||
)
|
||||
option(WITH_DEBUG_KBD "Print keyboard related debug messages." ${DEFAULT_DEBUG_OPTION})
|
||||
if(WITH_DEBUG_KBD)
|
||||
message(WARNING "WITH_DEBUG_KBD=ON, the build might leak sensitive information, do not use with release builds!")
|
||||
endif()
|
||||
option(WITH_DEBUG_LICENSE "Print license debug messages." ${DEFAULT_DEBUG_OPTION})
|
||||
if(WITH_DEBUG_LICENSE)
|
||||
message(WARNING "WITH_DEBUG_LICENSE=ON, the build might leak sensitive information, do not use with release builds!")
|
||||
endif()
|
||||
option(WITH_DEBUG_NEGO "Print negotiation related debug messages." ${DEFAULT_DEBUG_OPTION})
|
||||
if(WITH_DEBUG_NEGO)
|
||||
message(WARNING "WITH_DEBUG_NEGO=ON, the build might leak sensitive information, do not use with release builds!")
|
||||
endif()
|
||||
option(WITH_DEBUG_NLA "Print authentication related debug messages." ${DEFAULT_DEBUG_OPTION})
|
||||
if(WITH_DEBUG_NLA)
|
||||
message(WARNING "WITH_DEBUG_NLA=ON, the build might leak sensitive information, do not use with release builds!")
|
||||
endif()
|
||||
option(WITH_DEBUG_TSG "Print Terminal Server Gateway debug messages" ${DEFAULT_DEBUG_OPTION})
|
||||
option(WITH_DEBUG_RAIL "Print RemoteApp debug messages" ${DEFAULT_DEBUG_OPTION})
|
||||
option(WITH_DEBUG_RDP "Print RDP debug messages" ${DEFAULT_DEBUG_OPTION})
|
||||
option(WITH_DEBUG_RDPEI "Print input virtual channel debug messages" ${DEFAULT_DEBUG_OPTION})
|
||||
option(WITH_DEBUG_REDIR "Redirection debug messages" ${DEFAULT_DEBUG_OPTION})
|
||||
option(WITH_DEBUG_RDPDR "Rdpdr debug messages" ${DEFAULT_DEBUG_OPTION})
|
||||
option(WITH_DEBUG_RFX "Print RemoteFX debug messages." ${DEFAULT_DEBUG_OPTION})
|
||||
option(WITH_DEBUG_SCARD "Print smartcard debug messages" ${DEFAULT_DEBUG_OPTION})
|
||||
option(WITH_DEBUG_SND "Print rdpsnd debug messages" ${DEFAULT_DEBUG_OPTION})
|
||||
option(WITH_DEBUG_SVC "Print static virtual channel debug messages." ${DEFAULT_DEBUG_OPTION})
|
||||
option(WITH_DEBUG_TRANSPORT "Print transport debug messages." ${DEFAULT_DEBUG_OPTION})
|
||||
option(WITH_DEBUG_TIMEZONE "Print timezone debug messages." ${DEFAULT_DEBUG_OPTION})
|
||||
option(WITH_DEBUG_WND "Print window order debug messages" ${DEFAULT_DEBUG_OPTION})
|
||||
option(WITH_DEBUG_X11_LOCAL_MOVESIZE "Print X11 Client local movesize debug messages" ${DEFAULT_DEBUG_OPTION})
|
||||
option(WITH_DEBUG_X11 "Print X11 Client debug messages" ${DEFAULT_DEBUG_OPTION})
|
||||
option(WITH_DEBUG_XV "Print XVideo debug messages" ${DEFAULT_DEBUG_OPTION})
|
||||
option(WITH_DEBUG_RINGBUFFER "Enable Ringbuffer debug messages" ${DEFAULT_DEBUG_OPTION})
|
||||
|
||||
option(WITH_DEBUG_SYMBOLS "Pack debug symbols to installer" OFF)
|
||||
option(WITH_CCACHE "Use ccache support if available" ON)
|
||||
option(WITH_CLANG_FORMAT "Detect clang-format. run 'cmake --build . --target clangformat' to format." ON)
|
||||
|
||||
option(WITH_DSP_EXPERIMENTAL "Enable experimental sound encoder/decoder formats" OFF)
|
||||
|
||||
option(WITH_FFMPEG "Enable FFMPEG for audio/video encoding/decoding" ON)
|
||||
cmake_dependent_option(WITH_DSP_FFMPEG "Use FFMPEG for audio encoding/decoding" ON "WITH_FFMPEG" OFF)
|
||||
cmake_dependent_option(WITH_VIDEO_FFMPEG "Use FFMPEG for video encoding/decoding" ON "WITH_FFMPEG" OFF)
|
||||
cmake_dependent_option(WITH_VAAPI "[experimental] Use FFMPEG VAAPI" OFF "WITH_VIDEO_FFMPEG" OFF)
|
||||
cmake_dependent_option(
|
||||
WITH_VAAPI_H264_ENCODING "[experimental] Use FFMPEG VAAPI hardware H264 encoding" ON "WITH_VIDEO_FFMPEG" OFF
|
||||
)
|
||||
if(WITH_VAAPI_H264_ENCODING)
|
||||
add_definitions("-DWITH_VAAPI_H264_ENCODING")
|
||||
endif()
|
||||
|
||||
option(WITH_CAIRO "Use CAIRO image library for screen resizing" OFF)
|
||||
option(WITH_SWSCALE "Use SWScale image library for screen resizing" ON)
|
||||
|
||||
if(ANDROID)
|
||||
include(ConfigOptionsAndroid)
|
||||
endif(ANDROID)
|
||||
|
||||
if(IOS)
|
||||
include(ConfigOptionsiOS)
|
||||
endif(IOS)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
find_package(ALSA)
|
||||
find_package(PulseAudio)
|
||||
find_package(OSS)
|
||||
option(WITH_ALSA "use alsa for sound" ${ALSA_FOUND})
|
||||
option(WITH_PULSE "use alsa for sound" ${PULSE_FOUND})
|
||||
option(WITH_OSS "use alsa for sound" ${OSS_FOUND})
|
||||
endif()
|
||||
|
||||
if(OPENBSD)
|
||||
find_package(SNDIO)
|
||||
option(WITH_SNDIO "use SNDIO for sound" ${SNDIO_FOUND # OpenBSD
|
||||
endif () }
|
||||
)
|
||||
endif()
|
||||
|
||||
option(BUILD_FUZZERS "Use BUILD_FUZZERS to build fuzzing tests" OFF)
|
||||
|
||||
if(BUILD_FUZZERS)
|
||||
if(NOT OSS_FUZZ)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=fuzzer-no-link")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=fuzzer-no-link")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=fuzzer-no-link")
|
||||
endif()
|
||||
|
||||
if(OSS_FUZZ AND NOT DEFINED ENV{LIB_FUZZING_ENGINE})
|
||||
message(SEND_ERROR "OSS-Fuzz builds require the environment variable "
|
||||
"LIB_FUZZING_ENGINE to be set. If you are seeing this "
|
||||
"warning, it points to a deeper problem in the ossfuzz " "build setup."
|
||||
)
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
message(FATAL_ERROR "\n" "Fuzzing is unsupported with GCC compiler. Use Clang:\n"
|
||||
" $ CC=clang CXX=clang++ cmake . <...> -DBUILD_FUZZERS=ON && make -j\n" "\n"
|
||||
)
|
||||
endif()
|
||||
|
||||
set(BUILD_TESTING_INTERNAL ON CACHE BOOL "fuzzer default" FORCE)
|
||||
|
||||
if(BUILD_SHARED_LIBS STREQUAL "OFF")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
||||
set(CMAKE_CXX_FLAGS "-static ${CMAKE_CXX_FLAGS}")
|
||||
endif()
|
||||
|
||||
# A special target with fuzzer and sanitizer flags.
|
||||
add_library(fuzzer_config INTERFACE)
|
||||
|
||||
target_compile_options(
|
||||
fuzzer_config
|
||||
INTERFACE $<$<NOT:$<BOOL:${OSS_FUZZ}>>:
|
||||
-fsanitize=fuzzer
|
||||
>
|
||||
$<$<BOOL:${OSS_FUZZ}>:
|
||||
${CXX}
|
||||
${CXXFLAGS}
|
||||
>
|
||||
)
|
||||
target_link_libraries(
|
||||
fuzzer_config INTERFACE $<$<NOT:$<BOOL:${OSS_FUZZ}>>: -fsanitize=fuzzer > $<$<BOOL:${OSS_FUZZ}>:
|
||||
$ENV{LIB_FUZZING_ENGINE} >
|
||||
)
|
||||
endif()
|
||||
|
||||
option(
|
||||
WITH_FULL_CONFIG_PATH
|
||||
"Use <appdata>/Vendor/Product instead of <appdata>/product (lowercase, only if vendor equals product) as config directory"
|
||||
OFF
|
||||
)
|
||||
|
||||
# Configuration settings for manpages
|
||||
if(NOT WITH_FULL_CONFIG_PATH AND "${VENDOR}" STREQUAL "${PRODUCT}")
|
||||
string(TOLOWER "${VENDOR}" VENDOR_PRODUCT)
|
||||
else()
|
||||
set(VENDOR_PRODUCT "${VENDOR}/${PRODUCT}")
|
||||
endif()
|
||||
22
third_party/FreeRDP/cmake/ConfigOptionsAndroid.cmake
vendored
Normal file
22
third_party/FreeRDP/cmake/ConfigOptionsAndroid.cmake
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
# FreeRDP cmake android options
|
||||
#
|
||||
# Copyright 2013 Thincast Technologies GmbH
|
||||
# Copyright 2013 Bernhard Miklautz <bernhard.miklautz@thincast.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.
|
||||
|
||||
option(WITH_OPENSLES "Enable sound and microphone redirection using OpenSLES" ON)
|
||||
|
||||
set(ANDROID_APP_TARGET_SDK 21 CACHE STRING "Application target android SDK")
|
||||
set(ANDROID_APP_MIN_SDK 14 CACHE STRING "Application minimum android SDK requirement")
|
||||
option(WITH_MEDIACODEC "[experimental] Use MediaCodec API (currently no fallback if no device support)" OFF)
|
||||
25
third_party/FreeRDP/cmake/ConfigOptionsiOS.cmake
vendored
Normal file
25
third_party/FreeRDP/cmake/ConfigOptionsiOS.cmake
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
# FreeRDP cmake ios options
|
||||
#
|
||||
# Copyright 2013 Thincast Technologies GmbH
|
||||
# Copyright 2013 Martin Fleisz <martin.fleisz@thincast.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.
|
||||
|
||||
if(NOT FREERDP_IOS_EXTERNAL_SSL_PATH)
|
||||
set(FREERDP_IOS_EXTERNAL_SSL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external/openssl")
|
||||
endif()
|
||||
mark_as_advanced(FREERDP_IOS_EXTERNAL_SSL_PATH)
|
||||
|
||||
if(NOT DEFINED IOS_TARGET_SDK)
|
||||
set(IOS_TARGET_SDK 12.0 CACHE STRING "Application target iOS SDK")
|
||||
endif()
|
||||
10
third_party/FreeRDP/cmake/ConfigureFreeRDP.cmake
vendored
Normal file
10
third_party/FreeRDP/cmake/ConfigureFreeRDP.cmake
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
if(NOT FREERDP_UNIFIED_BUILD)
|
||||
find_package(WinPR 3 REQUIRED)
|
||||
include_directories(SYSTEM ${WinPR_INCLUDE_DIR})
|
||||
|
||||
find_package(FreeRDP 3 REQUIRED)
|
||||
include_directories(SYSTEM ${FreeRDP_INCLUDE_DIR})
|
||||
|
||||
find_package(FreeRDP-Client 3 REQUIRED)
|
||||
include_directories(SYSTEM ${FreeRDP-Client_INCLUDE_DIR})
|
||||
endif()
|
||||
61
third_party/FreeRDP/cmake/ConfigureRPATH.cmake
vendored
Normal file
61
third_party/FreeRDP/cmake/ConfigureRPATH.cmake
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
# RPATH configuration
|
||||
option(CMAKE_SKIP_BUILD_RPATH "skip build RPATH" OFF)
|
||||
option(CMAKE_BUILD_WITH_INSTALL_RPATH "build with install RPATH" OFF)
|
||||
option(CMAKE_INSTALL_RPATH_USE_LINK_PATH "build with link RPATH" OFF)
|
||||
|
||||
if(APPLE)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
option(CMAKE_MACOSX_RPATH "MacOSX RPATH" ON)
|
||||
endif()
|
||||
|
||||
file(RELATIVE_PATH FRAMEWORK_PATH ${CMAKE_INSTALL_FULL_BINDIR} ${CMAKE_INSTALL_FULL_LIBDIR})
|
||||
set(CFG_INSTALL_RPATH "@loader_path/${FRAMEWORK_PATH}")
|
||||
elseif(NOT WIN32)
|
||||
if(NOT FREEBSD)
|
||||
option(WITH_ADD_PLUGIN_TO_RPATH "Add extension and plugin path to RPATH" OFF)
|
||||
if(WITH_ADD_PLUGIN_TO_RPATH)
|
||||
set(CFG_INSTALL_RPATH
|
||||
"\$ORIGIN/../${FREERDP_EXTENSION_REL_PATH}:\$ORIGIN/../${FREERDP_PLUGIN_PATH}:\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:\$ORIGIN/.."
|
||||
)
|
||||
else()
|
||||
set(CFG_INSTALL_RPATH "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:\$ORIGIN/..")
|
||||
endif()
|
||||
endif()
|
||||
endif(APPLE)
|
||||
|
||||
set(CMAKE_INSTALL_RPATH ${CFG_INSTALL_RPATH} CACHE INTERNAL "ConfigureRPATH")
|
||||
message("Configured RPATH=${CMAKE_INSTALL_RPATH}")
|
||||
|
||||
function(installWithRPATH)
|
||||
if(NOT APPLE AND NOT FREEBSD AND NOT WIN32)
|
||||
list(FIND ARGN "TARGETS" _index)
|
||||
if(${_index} GREATER -1)
|
||||
math(EXPR _index "${_index}+1")
|
||||
list(GET ARGN ${_index} target)
|
||||
else()
|
||||
message(FATAL_ERROR "Missing TARGETS for install directive")
|
||||
endif()
|
||||
list(FIND ARGN "DESTINATION" _index)
|
||||
if(${_index} GREATER -1)
|
||||
math(EXPR _index "${_index}+1")
|
||||
list(GET ARGN ${_index} path)
|
||||
else()
|
||||
message(FATAL_ERROR "Missing DESTINATION for install directive")
|
||||
endif()
|
||||
|
||||
get_filename_component(ABS_PATH ${path} ABSOLUTE BASE_DIR ${CMAKE_INSTALL_PREFIX})
|
||||
file(RELATIVE_PATH REL_PATH ${ABS_PATH} ${CMAKE_INSTALL_PREFIX})
|
||||
if(WITH_ADD_PLUGIN_TO_RPATH)
|
||||
set_target_properties(
|
||||
${target}
|
||||
PROPERTIES
|
||||
INSTALL_RPATH
|
||||
"\$ORIGIN/${REL_PATH}${FREERDP_EXTENSION_REL_PATH}:\$ORIGIN/${REL_PATH}${FREERDP_PLUGIN_PATH}:\$ORIGIN/${REL_PATH}${CMAKE_INSTALL_LIBDIR}"
|
||||
)
|
||||
else()
|
||||
set_target_properties(${target} PROPERTIES INSTALL_RPATH "\$ORIGIN/${REL_PATH}${CMAKE_INSTALL_LIBDIR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
install(${ARGN})
|
||||
endfunction()
|
||||
16
third_party/FreeRDP/cmake/ConvertFileToHexArray.cmake
vendored
Normal file
16
third_party/FreeRDP/cmake/ConvertFileToHexArray.cmake
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
function(file_to_hex_array FILE DATA)
|
||||
# Read the ASCII file as hex.
|
||||
file(READ "${FILE}" HEX_CONTENTS HEX)
|
||||
|
||||
# Separate into individual bytes.
|
||||
string(REGEX MATCHALL "([A-Za-z0-9][A-Za-z0-9])" SEPARATED_HEX "${HEX_CONTENTS}")
|
||||
|
||||
# Append the "0x" to each byte.
|
||||
list(JOIN SEPARATED_HEX ", 0x" FORMATTED_HEX)
|
||||
|
||||
# JOIN misses the first byte's "0x", so add it here.
|
||||
string(PREPEND FORMATTED_HEX "0x")
|
||||
|
||||
# Set the variable named by DATA argument to the formatted hex string.
|
||||
set(${DATA} ${FORMATTED_HEX} PARENT_SCOPE)
|
||||
endfunction()
|
||||
110
third_party/FreeRDP/cmake/DetectIntrinsicSupport.cmake
vendored
Normal file
110
third_party/FreeRDP/cmake/DetectIntrinsicSupport.cmake
vendored
Normal file
@@ -0,0 +1,110 @@
|
||||
option(WITH_SIMD "Enable best platform specific vector instruction support" ON)
|
||||
cmake_dependent_option(WITH_AVX2 "Compile AVX2 optimizations." ON "WITH_SIMD" OFF)
|
||||
|
||||
if(WITH_SSE2)
|
||||
message(WARNING "WITH_SSE2 is deprecated, use WITH_SIMD instead")
|
||||
set(WITH_SIMD ON CACHE BOOL "WITH_SSE2")
|
||||
endif()
|
||||
if(WITH_NEON)
|
||||
message(WARNING "WITH_NEON is deprecated, use WITH_SIMD instead")
|
||||
set(WITH_SIMD ON CACHE BOOL "WITH_NEON")
|
||||
endif()
|
||||
|
||||
macro(set_simd_source_file_properties INTRINSIC_TYPE)
|
||||
if(ARGC LESS_EQUAL 1)
|
||||
message(FATAL_ERROR "set_simd_source_file_properties called with invalid arguments: [${ARGC}] {${ARGN}")
|
||||
endif()
|
||||
|
||||
# see https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html
|
||||
set(GCC_CLANG_NAMES "AppleClang;Clang;CrayClang;FujitsuClang;GNU;IntelLLVM;TIClang;XLClang;IBMClang")
|
||||
|
||||
set(SSE_X86_LIST "i686;x86")
|
||||
set(SSE_LIST "x86_64;ia64;x64;amd64;ia64;em64t;${SSE_X86_LIST}")
|
||||
set(NEON_LIST "arm;armv7;armv8b;armv8l;aarch64")
|
||||
set(SUPPORTED_INTRINSICS_LIST "neon;sse2;sse3;ssse3;sse4.1;sse4.2;avx2")
|
||||
|
||||
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSTEM_PROCESSOR)
|
||||
|
||||
if(NOT "${INTRINSIC_TYPE}" IN_LIST SUPPORTED_INTRINSICS_LIST)
|
||||
message(WARNING "Intrinsic type ${INTRINSIC_TYPE} not supported, only ${SUPPORTED_INTRINSICS_LIST} are available")
|
||||
else()
|
||||
set(SIMD_LINK_ARG "")
|
||||
if(MSVC)
|
||||
# https://learn.microsoft.com/en-us/cpp/build/reference/arch-x64?view=msvc-140
|
||||
if("${SYSTEM_PROCESSOR}" IN_LIST SSE_LIST)
|
||||
if("${SYSTEM_PROCESSOR}" IN_LIST SSE_X86_LIST)
|
||||
# /arch:SSE2 is the default, so do nothing
|
||||
set(SIMD_LINK_ARG "ignore")
|
||||
if("${INTRINSIC_TYPE}" STREQUAL "avx2")
|
||||
set(SIMD_LINK_ARG "/arch:AVX2")
|
||||
endif()
|
||||
else()
|
||||
# /arch:SSE2 is the default, so do nothing
|
||||
set(SIMD_LINK_ARG "ignore")
|
||||
if("${INTRINSIC_TYPE}" STREQUAL "sse4.2")
|
||||
set(SIMD_LINK_ARG "/arch:SSE4.2")
|
||||
elseif("${INTRINSIC_TYPE}" STREQUAL "avx2")
|
||||
set(SIMD_LINK_ARG "/arch:AVX2")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
elseif("${CMAKE_C_COMPILER_ID}" IN_LIST GCC_CLANG_NAMES)
|
||||
set(HAVE_SSE_AVX OFF)
|
||||
foreach(ARCH ${CMAKE_OSX_ARCHITECTURES})
|
||||
if("${ARCH}" IN_LIST SSE_LIST)
|
||||
set(HAVE_SSE_AVX ON)
|
||||
endif()
|
||||
endforeach()
|
||||
if("${SYSTEM_PROCESSOR}" IN_LIST SSE_LIST OR HAVE_SSE_AVX)
|
||||
if("${INTRINSIC_TYPE}" STREQUAL "sse2")
|
||||
set(SIMD_LINK_ARG "-msse2")
|
||||
elseif("${INTRINSIC_TYPE}" STREQUAL "sse3")
|
||||
set(SIMD_LINK_ARG "-msse3")
|
||||
elseif("${INTRINSIC_TYPE}" STREQUAL "ssse3")
|
||||
set(SIMD_LINK_ARG "-mssse3")
|
||||
elseif("${INTRINSIC_TYPE}" STREQUAL "sse4.1")
|
||||
set(SIMD_LINK_ARG "-msse4.1")
|
||||
elseif("${INTRINSIC_TYPE}" STREQUAL "sse4.2")
|
||||
set(SIMD_LINK_ARG "-msse4.2")
|
||||
elseif("${INTRINSIC_TYPE}" STREQUAL "avx2")
|
||||
set(SIMD_LINK_ARG "-mavx2")
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
message(WARNING "[SIMD] Unsupported compiler ${CMAKE_C_COMPILER_ID}, ignoring")
|
||||
endif()
|
||||
|
||||
if("${INTRINSIC_TYPE}" STREQUAL "neon")
|
||||
set(HAVE_NEON OFF)
|
||||
foreach(ARCH ${CMAKE_OSX_ARCHITECTURES})
|
||||
if("${ARCH}" IN_LIST NEON_LIST)
|
||||
set(HAVE_NEON ON)
|
||||
endif()
|
||||
endforeach()
|
||||
if("${SYSTEM_PROCESSOR}" IN_LIST NEON_LIST OR HAVE_NEON)
|
||||
if(MSVC)
|
||||
set(SIMD_LINK_ARG "/arch:VFPv4")
|
||||
elseif("${CMAKE_C_COMPILER_ID}" IN_LIST GCC_CLANG_NAMES)
|
||||
if("${SYSTEM_PROCESSOR}" STREQUAL "aarch64")
|
||||
set(SIMD_LINK_ARG "ignore")
|
||||
else()
|
||||
set(SIMD_LINK_ARG "-mfpu=neon")
|
||||
endif()
|
||||
else()
|
||||
message(WARNING "[SIMD] Unsupported compiler ${CMAKE_C_COMPILER_ID}, ignoring")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(SIMD_LINK_ARG STREQUAL "")
|
||||
message(NOTICE "INTRINSIC_TYPE=${INTRINSIC_TYPE}: not supported on target platform, ignoring")
|
||||
elseif(SIMD_LINK_ARG STREQUAL "ignore")
|
||||
message(NOTICE "INTRINSIC_TYPE=${INTRINSIC_TYPE}: does not require linker flags, enabled by default")
|
||||
else()
|
||||
message("[SIMD] linking ${INTRINSIC_TYPE} [${SIMD_LINK_ARG}]: ${ARGN}")
|
||||
foreach(src ${ARGN})
|
||||
set_source_files_properties(${src} PROPERTIES COMPILE_FLAGS "${SIMD_LINK_ARG}")
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
18
third_party/FreeRDP/cmake/DisableCompilerWarnings.cmake
vendored
Normal file
18
third_party/FreeRDP/cmake/DisableCompilerWarnings.cmake
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
if(MSVC)
|
||||
set(COMPILE_WARN_OPTS "/W0")
|
||||
else()
|
||||
set(COMPILE_WARN_OPTS "-w")
|
||||
endif()
|
||||
set(COMPILE_WARN_OPTS "${COMPILE_WARN_OPTS}" CACHE STRING "cached value")
|
||||
|
||||
function(disable_warnings_for_directory dir)
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.19.0")
|
||||
set_property(DIRECTORY "${dir}" PROPERTY COMPILE_OPTIONS ${COMPILE_WARN_OPTS})
|
||||
endif()
|
||||
|
||||
file(MAKE_DIRECTORY "${dir}")
|
||||
set(ctidy "${dir}/.clang-tidy")
|
||||
file(WRITE ${ctidy} "Checks: '-*,misc-definitions-in-headers'\n")
|
||||
file(APPEND ${ctidy} "CheckOptions:\n")
|
||||
file(APPEND ${ctidy} "\t- { key: HeaderFileExtensions, value: \"x\" }\n")
|
||||
endfunction()
|
||||
21
third_party/FreeRDP/cmake/Doxygen.cmake
vendored
Normal file
21
third_party/FreeRDP/cmake/Doxygen.cmake
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
option(WITH_DOCUMENTATION "Add target to build doxygen documentation" OFF)
|
||||
|
||||
if(WITH_DOCUMENTATION)
|
||||
if(CMAKE_VERSION VERSION_LESS "3.27")
|
||||
message(WARNING "Building with CMake ${CMAKE_VERSION} but >= 3.27 required for doxygen target")
|
||||
else()
|
||||
include(FindDoxygen)
|
||||
find_package(Doxygen REQUIRED dot OPTIONAL_COMPONENTS mscgen dia)
|
||||
|
||||
set(DOXYGEN_PROJECT_NAME ${PROJECT_NAME})
|
||||
set(DOXYGEN_PROJECT_NUMBER ${PROJECT_VERSION})
|
||||
set(DOXYGEN_EXCLUDE_PATTERNS "*/uwac/protocols/*")
|
||||
set(DOXYGEN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/docs")
|
||||
|
||||
doxygen_add_docs(
|
||||
docs "${CMAKE_SOURCE_DIR}" ALL COMMENT "Generate doxygen docs"
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/docs" CONFIG_FILE "${CMAKE_SOURCE_DIR}/docs/Doxyfile"
|
||||
)
|
||||
install(DIRECTORY "${CMAKE_SOURCE_DIR}/docs/api" DESTINATION ${CMAKE_INSTALL_DOCDIR})
|
||||
endif()
|
||||
endif()
|
||||
9
third_party/FreeRDP/cmake/DumpVariables.cmake
vendored
Normal file
9
third_party/FreeRDP/cmake/DumpVariables.cmake
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
function(dump_cmake_variables)
|
||||
get_cmake_property(_variableNames VARIABLES)
|
||||
list(SORT _variableNames)
|
||||
foreach(_variableName ${_variableNames})
|
||||
if((NOT DEFINED ARGV0) OR _variableName MATCHES ${ARGV0})
|
||||
message(STATUS "${_variableName}=${${_variableName}}")
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
177
third_party/FreeRDP/cmake/EchoTarget.cmake
vendored
Normal file
177
third_party/FreeRDP/cmake/EchoTarget.cmake
vendored
Normal file
@@ -0,0 +1,177 @@
|
||||
function(echo_target_property tgt prop)
|
||||
# v for value, d for defined, s for set
|
||||
get_property(v TARGET ${tgt} PROPERTY ${prop})
|
||||
get_property(d TARGET ${tgt} PROPERTY ${prop} DEFINED)
|
||||
get_property(s TARGET ${tgt} PROPERTY ${prop} SET)
|
||||
|
||||
# only produce output for values that are set
|
||||
if(s)
|
||||
message("tgt='${tgt}' prop='${prop}'")
|
||||
message(" value='${v}'")
|
||||
message(" defined='${d}'")
|
||||
message(" set='${s}'")
|
||||
message("")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(echo_target tgt)
|
||||
if(NOT TARGET ${tgt})
|
||||
message("There is no target named '${tgt}'")
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(props
|
||||
DEBUG_OUTPUT_NAME
|
||||
RELEASE_OUTPUT_NAME
|
||||
DEBUG_POSTFIX
|
||||
RELEASE_POSTFIX
|
||||
ARCHIVE_OUTPUT_DIRECTORY
|
||||
ARCHIVE_OUTPUT_DIRECTORY_DEBUG
|
||||
ARCHIVE_OUTPUT_DIRECTORY_RELEASE
|
||||
ARCHIVE_OUTPUT_NAME
|
||||
ARCHIVE_OUTPUT_NAME_DEBUG
|
||||
ARCHIVE_OUTPUT_NAME_RELEASE
|
||||
AUTOMOC
|
||||
AUTOMOC_MOC_OPTIONS
|
||||
BUILD_WITH_INSTALL_RPATH
|
||||
BUNDLE
|
||||
BUNDLE_EXTENSION
|
||||
COMPILE_DEFINITIONS
|
||||
COMPILE_DEFINITIONS_DEBUG
|
||||
COMPILE_DEFINITIONS_RELEASE
|
||||
COMPILE_FLAGS
|
||||
DEBUG_POSTFIX
|
||||
DEFINE_SYMBOL
|
||||
ENABLE_EXPORTS
|
||||
EXCLUDE_FROM_ALL
|
||||
EchoString
|
||||
FOLDER
|
||||
FRAMEWORK
|
||||
Fortran_FORMAT
|
||||
Fortran_MODULE_DIRECTORY
|
||||
GENERATOR_FILE_NAME
|
||||
GNUtoMS
|
||||
HAS_CXX
|
||||
IMPLICIT_DEPENDS_INCLUDE_TRANSFORM
|
||||
IMPORTED
|
||||
IMPORTED_CONFIGURATIONS
|
||||
IMPORTED_IMPLIB
|
||||
IMPORTED_IMPLIB_RELEASE
|
||||
IMPORTED_IMPLIB_RELEASE
|
||||
IMPORTED_LINK_DEPENDENT_LIBRARIES
|
||||
IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBUG
|
||||
IMPORTED_LINK_DEPENDENT_LIBRARIES_RELEASE
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE
|
||||
IMPORTED_LINK_INTERFACE_LIBRARIES
|
||||
IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG
|
||||
IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE
|
||||
IMPORTED_LINK_INTERFACE_MULTIPLICITY
|
||||
IMPORTED_LINK_INTERFACE_MULTIPLICITY_DEBUG
|
||||
IMPORTED_LINK_INTERFACE_MULTIPLICITY_RELEASE
|
||||
IMPORTED_LOCATION
|
||||
IMPORTED_LOCATION_DEBUG
|
||||
IMPORTED_LOCATION_RELEASE
|
||||
IMPORTED_NO_SONAME
|
||||
IMPORTED_NO_SONAME_DEBUG
|
||||
IMPORTED_NO_SONAME_RELEASE
|
||||
IMPORTED_SONAME
|
||||
IMPORTED_SONAME_DEBUG
|
||||
IMPORTED_SONAME_RELEASE
|
||||
IMPORT_PREFIX
|
||||
IMPORT_SUFFIX
|
||||
INCLUDE_DIRECTORIES
|
||||
INSTALL_NAME_DIR
|
||||
INSTALL_RPATH
|
||||
INSTALL_RPATH_USE_LINK_PATH
|
||||
INTERPROCEDURAL_OPTIMIZATION
|
||||
INTERPROCEDURAL_OPTIMIZATION_DEBUG
|
||||
INTERPROCEDURAL_OPTIMIZATION_RELEASE
|
||||
LABELS
|
||||
LIBRARY_OUTPUT_DIRECTORY
|
||||
LIBRARY_OUTPUT_DIRECTORY_DEBUG
|
||||
LIBRARY_OUTPUT_DIRECTORY_RELEASE
|
||||
LIBRARY_OUTPUT_NAME
|
||||
LIBRARY_OUTPUT_NAME_DEBUG
|
||||
LIBRARY_OUTPUT_NAME_RELEASE
|
||||
LINKER_LANGUAGE
|
||||
LINK_DEPENDS
|
||||
LINK_LIBRARIES
|
||||
LINK_FLAGS
|
||||
LINK_FLAGS_DEBUG
|
||||
LINK_FLAGS_RELEASE
|
||||
LINK_INTERFACE_LIBRARIES
|
||||
LINK_INTERFACE_LIBRARIES_DEBUG
|
||||
LINK_INTERFACE_LIBRARIES_RELEASE
|
||||
LINK_INTERFACE_MULTIPLICITY
|
||||
LINK_INTERFACE_MULTIPLICITY_DEBUG
|
||||
LINK_INTERFACE_MULTIPLICITY_RELEASE
|
||||
LINK_SEARCH_END_STATIC
|
||||
LINK_SEARCH_START_STATIC
|
||||
LOCATION
|
||||
LOCATION_DEBUG
|
||||
LOCATION_RELEASE
|
||||
MACOSX_BUNDLE
|
||||
MACOSX_BUNDLE_INFO_PLIST
|
||||
MACOSX_FRAMEWORK_INFO_PLIST
|
||||
MAP_IMPORTED_CONFIG_DEBUG
|
||||
MAP_IMPORTED_CONFIG_RELEASE
|
||||
OSX_ARCHITECTURES
|
||||
OSX_ARCHITECTURES_DEBUG
|
||||
OSX_ARCHITECTURES_RELEASE
|
||||
OUTPUT_NAME
|
||||
OUTPUT_NAME_DEBUG
|
||||
OUTPUT_NAME_RELEASE
|
||||
POST_INSTALL_SCRIPT
|
||||
PREFIX
|
||||
PRE_INSTALL_SCRIPT
|
||||
PRIVATE_HEADER
|
||||
PROJECT_LABEL
|
||||
PUBLIC_HEADER
|
||||
RESOURCE
|
||||
RULE_LAUNCH_COMPILE
|
||||
RULE_LAUNCH_CUSTOM
|
||||
RULE_LAUNCH_LINK
|
||||
RUNTIME_OUTPUT_DIRECTORY
|
||||
RUNTIME_OUTPUT_DIRECTORY_DEBUG
|
||||
RUNTIME_OUTPUT_DIRECTORY_RELEASE
|
||||
RUNTIME_OUTPUT_NAME
|
||||
RUNTIME_OUTPUT_NAME_DEBUG
|
||||
RUNTIME_OUTPUT_NAME_RELEASE
|
||||
SKIP_BUILD_RPATH
|
||||
SOURCES
|
||||
SOVERSION
|
||||
STATIC_LIBRARY_FLAGS
|
||||
STATIC_LIBRARY_FLAGS_DEBUG
|
||||
STATIC_LIBRARY_FLAGS_RELEASE
|
||||
SUFFIX
|
||||
TYPE
|
||||
VERSION
|
||||
VS_DOTNET_REFERENCES
|
||||
VS_GLOBAL_KEYWORD
|
||||
VS_GLOBAL_PROJECT_TYPES
|
||||
VS_KEYWORD
|
||||
VS_SCC_AUXPATH
|
||||
VS_SCC_LOCALPATH
|
||||
VS_SCC_PROJECTNAME
|
||||
VS_SCC_PROVIDER
|
||||
VS_WINRT_EXTENSIONS
|
||||
VS_WINRT_REFERENCES
|
||||
WIN32_EXECUTABLE
|
||||
)
|
||||
|
||||
message("======================== ${tgt} ========================")
|
||||
foreach(p ${props})
|
||||
echo_target_property("${tgt}" "${p}")
|
||||
endforeach()
|
||||
message("")
|
||||
|
||||
endfunction()
|
||||
|
||||
function(echo_targets)
|
||||
set(tgts ${ARGV})
|
||||
foreach(t ${tgts})
|
||||
echo_target("${t}")
|
||||
endforeach()
|
||||
endfunction()
|
||||
11
third_party/FreeRDP/cmake/ExportAllSymbols.cmake
vendored
Normal file
11
third_party/FreeRDP/cmake/ExportAllSymbols.cmake
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
include(CheckAndSetFlag)
|
||||
|
||||
option(EXPORT_ALL_SYMBOLS "Export all symbols form library" OFF)
|
||||
|
||||
if(EXPORT_ALL_SYMBOLS)
|
||||
add_compile_definitions(EXPORT_ALL_SYMBOLS)
|
||||
removeflag(-fvisibility=hidden)
|
||||
else()
|
||||
message(STATUS "${} default symbol visibility: hidden")
|
||||
checkandsetflag(-fvisibility=hidden)
|
||||
endif()
|
||||
107
third_party/FreeRDP/cmake/FindCairo.cmake
vendored
Normal file
107
third_party/FreeRDP/cmake/FindCairo.cmake
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
# - Try to find the CAIRO library
|
||||
# Once done this will define
|
||||
#
|
||||
# CAIRO_ROOT_DIR - Set this variable to the root installation of CAIRO
|
||||
#
|
||||
# Read-Only variables:
|
||||
# CAIRO_FOUND - system has the CAIRO library
|
||||
# CAIRO_INCLUDE_DIR - the CAIRO include directory
|
||||
# CAIRO_LIBRARIES - The libraries needed to use CAIRO
|
||||
# CAIRO_VERSION - This is set to $major.$minor.$revision (eg. 0.9.8)
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2012 Dmitry Baryshnikov <polimax at mail dot ru>
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
find_package(PkgConfig)
|
||||
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_CAIRO cairo)
|
||||
endif(PKG_CONFIG_FOUND)
|
||||
|
||||
set(_CAIRO_ROOT_HINTS $ENV{CAIRO} ${CAIRO_ROOT_DIR})
|
||||
set(_CAIRO_ROOT_PATHS $ENV{CAIRO}/src /usr /usr/local)
|
||||
set(_CAIRO_ROOT_HINTS_AND_PATHS HINTS ${_CAIRO_ROOT_HINTS} PATHS ${_CAIRO_ROOT_PATHS})
|
||||
|
||||
find_path(CAIRO_INCLUDE_DIR NAMES cairo.h HINTS ${_CAIRO_INCLUDEDIR} ${_CAIRO_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES include "include/cairo"
|
||||
)
|
||||
|
||||
if(NOT PKGCONFIG_FOUND AND WIN32 AND NOT CYGWIN)
|
||||
# MINGW should go here too
|
||||
if(MSVC)
|
||||
# Implementation details:
|
||||
# We are using the libraries located in the VC subdir instead of the parent directory even though :
|
||||
find_library(CAIRO_DEBUG NAMES cairod ${_CAIRO_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES "lib" "VC" "lib/VC")
|
||||
|
||||
find_library(CAIRO_RELEASE NAMES cairo ${_CAIRO_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES "lib" "VC" "lib/VC")
|
||||
|
||||
if(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
|
||||
if(NOT CAIRO_DEBUG)
|
||||
set(CAIRO_DEBUG ${CAIRO_RELEASE})
|
||||
endif(NOT CAIRO_DEBUG)
|
||||
set(CAIRO_LIBRARIES optimized ${CAIRO_RELEASE} debug ${CAIRO_DEBUG})
|
||||
else()
|
||||
set(CAIRO_LIBRARIES ${CAIRO_RELEASE})
|
||||
endif()
|
||||
mark_as_advanced(CAIRO_DEBUG CAIRO_RELEASE)
|
||||
elseif(MINGW)
|
||||
# same player, for MingW
|
||||
find_library(CAIRO NAMES cairo ${_CAIRO_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES "lib" "lib/MinGW")
|
||||
|
||||
mark_as_advanced(CAIRO)
|
||||
set(CAIRO_LIBRARIES ${CAIRO})
|
||||
else(MSVC)
|
||||
# Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues:
|
||||
find_library(CAIRO NAMES cairo HINTS ${_CAIRO_LIBDIR} ${_CAIRO_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES lib)
|
||||
|
||||
mark_as_advanced(CAIRO)
|
||||
set(CAIRO_LIBRARIES ${CAIRO})
|
||||
endif(MSVC)
|
||||
else()
|
||||
|
||||
find_library(
|
||||
CAIRO_LIBRARY NAMES cairo HINTS ${_CAIRO_LIBDIR} ${_CAIRO_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES "lib" "local/lib"
|
||||
)
|
||||
|
||||
mark_as_advanced(CAIRO_LIBRARY)
|
||||
|
||||
# compat defines
|
||||
set(CAIRO_LIBRARIES ${CAIRO_LIBRARY})
|
||||
|
||||
endif()
|
||||
|
||||
#message( STATUS "Cairo_FIND_VERSION=${Cairo_FIND_VERSION}.")
|
||||
#message( STATUS "CAIRO_INCLUDE_DIR=${CAIRO_INCLUDE_DIR}.")
|
||||
|
||||
# Fetch version from cairo-version.h if a version was requested by find_package()
|
||||
if(CAIRO_INCLUDE_DIR AND Cairo_FIND_VERSION)
|
||||
file(READ "${CAIRO_INCLUDE_DIR}/cairo-version.h" _CAIRO_VERSION_H_CONTENTS)
|
||||
string(REGEX REPLACE "^(.*\n)?#define[ \t]+CAIRO_VERSION_MAJOR[ \t]+([0-9]+).*" "\\2" CAIRO_VERSION_MAJOR
|
||||
${_CAIRO_VERSION_H_CONTENTS}
|
||||
)
|
||||
string(REGEX REPLACE "^(.*\n)?#define[ \t]+CAIRO_VERSION_MINOR[ \t]+([0-9]+).*" "\\2" CAIRO_VERSION_MINOR
|
||||
${_CAIRO_VERSION_H_CONTENTS}
|
||||
)
|
||||
string(REGEX REPLACE "^(.*\n)?#define[ \t]+CAIRO_VERSION_MICRO[ \t]+([0-9]+).*" "\\2" CAIRO_VERSION_MICRO
|
||||
${_CAIRO_VERSION_H_CONTENTS}
|
||||
)
|
||||
set(CAIRO_VERSION ${CAIRO_VERSION_MAJOR}.${CAIRO_VERSION_MINOR}.${CAIRO_VERSION_MICRO}
|
||||
CACHE INTERNAL "The version number for Cairo libraries"
|
||||
)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(Cairo REQUIRED_VARS CAIRO_LIBRARIES CAIRO_INCLUDE_DIR VERSION_VAR CAIRO_VERSION)
|
||||
|
||||
mark_as_advanced(CAIRO_INCLUDE_DIR CAIRO_LIBRARIES)
|
||||
12
third_party/FreeRDP/cmake/FindFAAC.cmake
vendored
Normal file
12
third_party/FreeRDP/cmake/FindFAAC.cmake
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
find_path(FAAC_INCLUDE_DIR faac.h)
|
||||
|
||||
find_library(FAAC_LIBRARY faac)
|
||||
|
||||
find_package_handle_standard_args(FAAC DEFAULT_MSG FAAC_INCLUDE_DIR FAAC_LIBRARY)
|
||||
|
||||
if(FAAC_FOUND)
|
||||
set(FAAC_LIBRARIES ${FAAC_LIBRARY})
|
||||
set(FAAC_INCLUDE_DIRS ${FAAC_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(FAAC_INCLUDE_DIR FAAC_LIBRARY)
|
||||
12
third_party/FreeRDP/cmake/FindFAAD2.cmake
vendored
Normal file
12
third_party/FreeRDP/cmake/FindFAAD2.cmake
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
find_path(FAAD2_INCLUDE_DIR faad.h)
|
||||
|
||||
find_library(FAAD2_LIBRARY faad)
|
||||
|
||||
find_package_handle_standard_args(FAAD2 DEFAULT_MSG FAAD2_INCLUDE_DIR FAAD2_LIBRARY)
|
||||
|
||||
if(FAAD2_FOUND)
|
||||
set(FAAD2_LIBRARIES ${FAAD2_LIBRARY})
|
||||
set(FAAD2_INCLUDE_DIRS ${FAAD2_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(FAAD2_INCLUDE_DIR FAAD2_LIBRARY)
|
||||
208
third_party/FreeRDP/cmake/FindFFmpeg.cmake
vendored
Normal file
208
third_party/FreeRDP/cmake/FindFFmpeg.cmake
vendored
Normal file
@@ -0,0 +1,208 @@
|
||||
# vim: ts=2 sw=2
|
||||
# - Try to find the required ffmpeg components(default: AVFORMAT, AVUTIL, AVCODEC)
|
||||
#
|
||||
# Once done this will define
|
||||
# FFMPEG_FOUND - System has the all required components.
|
||||
# FFMPEG_INCLUDE_DIRS - Include directory necessary for using the required components headers.
|
||||
# FFMPEG_LIBRARIES - Link these to use the required ffmpeg components.
|
||||
# FFMPEG_DEFINITIONS - Compiler switches required for using the required ffmpeg components.
|
||||
#
|
||||
# For each of the components
|
||||
# - AVCODEC
|
||||
# - AVDEVICE
|
||||
# - AVFORMAT
|
||||
# - AVFILTER
|
||||
# - AVUTIL
|
||||
# - POSTPROCESS
|
||||
# - SWSCALE
|
||||
# - SWRESAMPLE
|
||||
# the following variables will be defined:
|
||||
# <component>_FOUND - System has <component>
|
||||
# <component>_INCLUDE_DIRS - Include directory necessary for using the <component> headers
|
||||
# <component>_LIBRARIES - Link these to use <component>
|
||||
# <component>_DEFINITIONS - Compiler switches required for using <component>
|
||||
# <component>_VERSION - The components version
|
||||
#
|
||||
# As the versions of the various FFmpeg components differ for a given release,
|
||||
# and CMake supports only one common version for all components, use the
|
||||
# following to specify required versions for multiple components:
|
||||
#
|
||||
# find_package(FFmpeg 57.48 COMPONENTS AVCODEC)
|
||||
# find_package(FFmpeg 57.40 COMPONENTS AVFORMAT)
|
||||
# find_package(FFmpeg 55.27 COMPONENTS AVUTIL)
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2006 Matthias Kretz <kretz@kde.org>
|
||||
# SPDX-FileCopyrightText: 2008 Alexander Neundorf <neundorf@kde.org>
|
||||
# SPDX-FileCopyrightText: 2011 Michael Jansen <kde@michael-jansen.biz>
|
||||
# SPDX-FileCopyrightText: 2021 Stefan Brüns <stefan.bruens@rwth-aachen.de>
|
||||
# SPDX-FileCopyrightText: 2024 Armin Novak <anovak@thincast.com>
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
if(NOT FFmpeg_FIND_COMPONENTS)
|
||||
# The default components were taken from a survey over other FindFFMPEG.cmake files
|
||||
set(FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL)
|
||||
endif()
|
||||
|
||||
list(LENGTH FFmpeg_FIND_COMPONENTS _numComponents)
|
||||
|
||||
if((${_numComponents} GREATER 1) AND DEFINED ${FFmpeg_FIND_VERSION})
|
||||
message(WARNING "Using a required version in combination with multiple COMPONENTS is not supported")
|
||||
set(_FFmpeg_REQUIRED_VERSION 0)
|
||||
elseif(DEFINED FFmpeg_FIND_VERSION)
|
||||
set(_FFmpeg_REQUIRED_VERSION ${FFmpeg_FIND_VERSION})
|
||||
else()
|
||||
set(_FFmpeg_REQUIRED_VERSION 0)
|
||||
endif()
|
||||
|
||||
set(_FFmpeg_ALL_COMPONENTS
|
||||
AVCODEC
|
||||
AVDEVICE
|
||||
AVFORMAT
|
||||
AVFILTER
|
||||
AVUTIL
|
||||
POSTPROCESS
|
||||
SWSCALE
|
||||
SWRESAMPLE
|
||||
)
|
||||
|
||||
#
|
||||
# ## Macro: set_component_found
|
||||
#
|
||||
# Marks the given component as found if both *_LIBRARIES AND *_INCLUDE_DIRS is present.
|
||||
#
|
||||
macro(set_component_found _component)
|
||||
if(${_component}_LIBRARIES AND ${_component}_INCLUDE_DIRS)
|
||||
set(${_component}_FOUND TRUE)
|
||||
set(FFmpeg_${_component}_FOUND TRUE)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
#
|
||||
# ## Macro: find_component
|
||||
#
|
||||
# Checks for the given component by invoking pkgconfig and then looking up the libraries and
|
||||
# include directories.
|
||||
#
|
||||
macro(find_component _component _pkgconfig _library _header)
|
||||
if(NOT WIN32)
|
||||
# use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
find_package(PkgConfig)
|
||||
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PC_${_component} QUIET ${_pkgconfig})
|
||||
endif()
|
||||
endif(NOT WIN32)
|
||||
|
||||
find_path(${_component}_INCLUDE_DIRS ${_header} HINTS ${PC_${_component}_INCLUDEDIR} ${PC_${_component}_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES ffmpeg
|
||||
)
|
||||
|
||||
find_library(
|
||||
${_component}_LIBRARIES NAMES ${_library} HINTS ${PC_${_component}_LIBDIR} ${PC_${_component}_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
set(${_component}_DEFINITIONS ${PC_${_component}_CFLAGS_OTHER} CACHE STRING "The ${_component} CFLAGS.")
|
||||
|
||||
# Fallback version detection:
|
||||
# Read version.h (and version_major.h if it exists) and try to extract the version
|
||||
if("${PC_${_component}_VERSION}_" STREQUAL "_")
|
||||
get_filename_component(${_component}_suffix "${_header}" DIRECTORY)
|
||||
find_file(${_component}_hdr_version_major NAMES version_major.h PATH_SUFFIXES ${${_component}_suffix}
|
||||
HINTS ${${_component}_INCLUDE_DIRS}
|
||||
)
|
||||
find_file(${_component}_hdr_version NAMES version.h PATH_SUFFIXES ${${_component}_suffix}
|
||||
HINTS ${${_component}_INCLUDE_DIRS}
|
||||
)
|
||||
if(NOT ${${_component}_hdr_version} MATCHES ".*-NOTFOUND")
|
||||
file(READ "${${_component}_hdr_version}" ${_component}_version_text)
|
||||
endif()
|
||||
if(NOT ${${_component}_hdr_version_major} MATCHES ".*-NOTFOUND")
|
||||
file(READ "${${_component}_hdr_version_major}" ${_component}_version_major_text)
|
||||
else()
|
||||
set(${_component}_version_major_text "${${_component}_version_text}")
|
||||
endif()
|
||||
|
||||
string(REGEX MATCH "#define[ \t]+.*_VERSION_MAJOR[ \t]+([0-9]+)" _ "${${_component}_version_major_text}")
|
||||
set(${_component}_version_major ${CMAKE_MATCH_1})
|
||||
string(REGEX MATCH "#define[ \t]+.*_VERSION_MINOR[ \t]+([0-9]+)" _ "${${_component}_version_text}")
|
||||
set(${_component}_version_minor ${CMAKE_MATCH_1})
|
||||
string(REGEX MATCH "#define[ \t]+.*_VERSION_MICRO[ \t]+([0-9]+)" _ "${${_component}_version_text}")
|
||||
set(${_component}_version_micro ${CMAKE_MATCH_1})
|
||||
|
||||
set(${_component}_VERSION
|
||||
"${${_component}_version_major}.${${_component}_version_minor}.${${_component}_version_micro}"
|
||||
CACHE STRING "The ${_component} version number."
|
||||
)
|
||||
else()
|
||||
set(${_component}_VERSION ${PC_${_component}_VERSION} CACHE STRING "The ${_component} version number.")
|
||||
endif()
|
||||
|
||||
set_component_found(${_component})
|
||||
|
||||
mark_as_advanced(${_component}_INCLUDE_DIRS ${_component}_LIBRARIES ${_component}_DEFINITIONS ${_component}_VERSION)
|
||||
endmacro()
|
||||
|
||||
# Check for cached results. If there are skip the costly part.
|
||||
if(NOT FFMPEG_LIBRARIES)
|
||||
# Check for all possible component.
|
||||
find_component(AVCODEC libavcodec avcodec libavcodec/avcodec.h)
|
||||
find_component(AVFORMAT libavformat avformat libavformat/avformat.h)
|
||||
find_component(AVFILTER libavfilter avfilter libavfilter/avfilter.h)
|
||||
find_component(AVDEVICE libavdevice avdevice libavdevice/avdevice.h)
|
||||
find_component(AVUTIL libavutil avutil libavutil/avutil.h)
|
||||
find_component(SWSCALE libswscale swscale libswscale/swscale.h)
|
||||
find_component(SWRESAMPLE libswresample swresample libswresample/swresample.h)
|
||||
find_component(POSTPROCESS libpostproc postproc libpostproc/postprocess.h)
|
||||
|
||||
# Check if the required components were found and add their stuff to the FFMPEG_* vars.
|
||||
foreach(_component ${_FFmpeg_ALL_COMPONENTS})
|
||||
if(${_component}_FOUND)
|
||||
set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${${_component}_LIBRARIES})
|
||||
set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} ${${_component}_DEFINITIONS})
|
||||
list(APPEND FFMPEG_INCLUDE_DIRS ${${_component}_INCLUDE_DIRS})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Build the include path with duplicates removed.
|
||||
if(FFMPEG_INCLUDE_DIRS)
|
||||
list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS)
|
||||
endif()
|
||||
|
||||
# cache the vars.
|
||||
set(FFMPEG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIRS} CACHE STRING "The FFmpeg include directories." FORCE)
|
||||
set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} CACHE STRING "The FFmpeg libraries." FORCE)
|
||||
set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} CACHE STRING "The FFmpeg cflags." FORCE)
|
||||
|
||||
mark_as_advanced(FFMPEG_INCLUDE_DIRS FFMPEG_LIBRARIES FFMPEG_DEFINITIONS)
|
||||
|
||||
else()
|
||||
# Set the noncached _FOUND vars for the components.
|
||||
foreach(_component ${_FFmpeg_ALL_COMPONENTS})
|
||||
set_component_found(${_component})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# Compile the list of required vars
|
||||
unset(_FFmpeg_REQUIRED_VARS)
|
||||
set(_FFmpeg_FOUND_LIBRARIES "")
|
||||
|
||||
foreach(_component ${FFmpeg_FIND_COMPONENTS})
|
||||
if(${_component}_FOUND)
|
||||
if(${_component}_VERSION VERSION_LESS _FFmpeg_REQUIRED_VERSION)
|
||||
message(STATUS "${_component}: ${${_component}_VERSION} < ${_FFmpeg_REQUIRED_VERSION}")
|
||||
unset(${_component}_FOUND)
|
||||
endif()
|
||||
|
||||
list(APPEND _FFmpeg_FOUND_LIBRARIES ${${_component}_LIBRARIES})
|
||||
endif()
|
||||
|
||||
list(APPEND _FFmpeg_REQUIRED_VARS ${_component}_LIBRARIES ${_component}_INCLUDE_DIRS ${_component}_FOUND)
|
||||
endforeach()
|
||||
|
||||
list(INSERT _FFmpeg_REQUIRED_VARS 0 _FFmpeg_FOUND_LIBRARIES)
|
||||
|
||||
# Give a nice error message if some of the required vars are missing.
|
||||
find_package_handle_standard_args(FFmpeg REQUIRED_VARS ${_FFmpeg_REQUIRED_VARS} HANDLE_COMPONENTS)
|
||||
64
third_party/FreeRDP/cmake/FindFeature.cmake
vendored
Normal file
64
third_party/FreeRDP/cmake/FindFeature.cmake
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
include(FeatureSummary)
|
||||
|
||||
# types: DISABLED < RUNTIME < OPTIONAL < RECOMMENDED < REQUIRED
|
||||
|
||||
macro(find_feature _feature _type _purpose _description)
|
||||
|
||||
string(TOUPPER ${_feature} _feature_upper)
|
||||
string(TOLOWER ${_type} _type_lower)
|
||||
|
||||
if(${_type} STREQUAL "DISABLED")
|
||||
set(_feature_default "OFF")
|
||||
message(STATUS "Skipping ${_type_lower} feature ${_feature} for ${_purpose} (${_description})")
|
||||
else()
|
||||
if(${_type} STREQUAL "REQUIRED")
|
||||
set(_feature_default "ON")
|
||||
message(STATUS "Finding ${_type_lower} feature ${_feature} for ${_purpose} (${_description})")
|
||||
find_package(${_feature} REQUIRED)
|
||||
elseif(${_type} STREQUAL "RECOMMENDED")
|
||||
if(NOT ${WITH_${_feature_upper}})
|
||||
set(_feature_default "OFF")
|
||||
message(STATUS "Skipping ${_type_lower} feature ${_feature} for ${_purpose} (${_description})")
|
||||
else()
|
||||
set(_feature_default "ON")
|
||||
message(STATUS "Finding ${_type_lower} feature ${_feature} for ${_purpose} (${_description})")
|
||||
message(STATUS " Disable feature ${_feature} using \"-DWITH_${_feature_upper}=OFF\"")
|
||||
find_package(${_feature})
|
||||
if(NOT ${_feature}_FOUND)
|
||||
set(_feature_default "OFF")
|
||||
message(
|
||||
STATUS "Not detected ${_type_lower} feature ${_feature} for ${_purpose} (${_description}), feature disabled"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
elseif(${_type} STREQUAL "OPTIONAL")
|
||||
if(${WITH_${_feature_upper}})
|
||||
set(_feature_default "ON")
|
||||
message(STATUS "Finding ${_type_lower} feature ${_feature} for ${_purpose} (${_description})")
|
||||
find_package(${_feature} REQUIRED)
|
||||
else()
|
||||
set(_feature_default "OFF")
|
||||
message(STATUS "Skipping ${_type_lower} feature ${_feature} for ${_purpose} (${_description})")
|
||||
message(STATUS " Enable feature ${_feature} using \"-DWITH_${_feature_upper}=ON\"")
|
||||
endif()
|
||||
else()
|
||||
set(_feature_default "ON")
|
||||
message(STATUS "Finding ${_type_lower} feature ${_feature} for ${_purpose} (${_description})")
|
||||
find_package(${_feature})
|
||||
endif()
|
||||
|
||||
if(NOT ${${_feature}_FOUND})
|
||||
if(${_feature_default})
|
||||
message(
|
||||
WARNING
|
||||
" feature ${_feature} was requested but could not be found! ${_feature_default} / ${${_feature}_FOUND}"
|
||||
)
|
||||
endif()
|
||||
set(_feature_default "OFF")
|
||||
endif()
|
||||
|
||||
option(WITH_${_feature_upper} "Enable feature ${_feature} for ${_purpose}" ${_feature_default})
|
||||
|
||||
set_package_properties(${_feature} PROPERTIES TYPE ${_type} PURPOSE "${_purpose}" DESCRIPTION "${_description}")
|
||||
endif()
|
||||
endmacro(find_feature)
|
||||
12
third_party/FreeRDP/cmake/FindGSM.cmake
vendored
Normal file
12
third_party/FreeRDP/cmake/FindGSM.cmake
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
find_path(GSM_INCLUDE_DIR gsm/gsm.h)
|
||||
|
||||
find_library(GSM_LIBRARY gsm)
|
||||
|
||||
find_package_handle_standard_args(GSM DEFAULT_MSG GSM_INCLUDE_DIR GSM_LIBRARY)
|
||||
|
||||
if(GSM_FOUND)
|
||||
set(GSM_LIBRARIES ${GSM_LIBRARY})
|
||||
set(GSM_INCLUDE_DIRS ${GSM_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(GSM_INCLUDE_DIR GSM_LIBRARY)
|
||||
213
third_party/FreeRDP/cmake/FindKRB5.cmake
vendored
Normal file
213
third_party/FreeRDP/cmake/FindKRB5.cmake
vendored
Normal file
@@ -0,0 +1,213 @@
|
||||
# - Try to find the Kerberos libraries
|
||||
# Once done this will define
|
||||
#
|
||||
# KRB5_ROOT_CONFIG - Set this variable to the full path of krb5-config of Kerberos
|
||||
# KRB5_ROOT_FLAVOUR - Set this variable to the flavour of Kerberos installation (MIT or Heimdal)
|
||||
#
|
||||
# Read-Only variables:
|
||||
# KRB5_FOUND - system has the Heimdal library
|
||||
# KRB5_FLAVOUR - "MIT" or "Heimdal" if anything found.
|
||||
# KRB5_INCLUDE_DIRS - the Heimdal include directory
|
||||
# KRB5_LIBRARIES - The libraries needed to use Kerberos
|
||||
# KRB5_LIBRARY_DIRS - Directories to add to linker search path
|
||||
# KRB5_LDFLAGS - Additional linker flags
|
||||
# KRB5_CFLAGS - Additional compiler flags
|
||||
# KRB5_VERSION - This is set to version advertised by pkg-config or read from manifest.
|
||||
# In case the library is found but no version info available it'll be set to "unknown"
|
||||
|
||||
include(CheckIncludeFile)
|
||||
include(CheckIncludeFiles)
|
||||
include(CheckTypeSize)
|
||||
|
||||
set(KRB5_ROOT_CONFIG "${KRB5_ROOT_CONFIG}" CACHE STRING
|
||||
"Force kerberos implementation by setting full path to krb5-config"
|
||||
)
|
||||
set(KRB5_ROOT_FLAVOUR "${KRB5_ROOT_FLAVOUR}"
|
||||
CACHE STRING "Force kerberos implementation by setting [mit|Heimdal]. Empty for default"
|
||||
)
|
||||
set(_KRB5_REQUIRED_VARS KRB5_FOUND KRB5_VERSION KRB5_FLAVOUR KRB5_INCLUDE_DIRS KRB5_LIBRARIES)
|
||||
|
||||
macro(PROVIDES_KRB5)
|
||||
set(PREFIX "MACRO_KRB5")
|
||||
|
||||
cmake_parse_arguments("${PREFIX}" "" "NAME" "" ${ARGN})
|
||||
|
||||
set(KRB5_FLAVOUR ${MACRO_KRB5_NAME})
|
||||
string(TOUPPER "${MACRO_KRB5_NAME}" MACRO_KRB5_NAME)
|
||||
|
||||
# This is a list of all variables that pkg_check_modules exports.
|
||||
set(VARIABLES
|
||||
"CFLAGS;CFLAGS_I;CFLAGS_OTHER;FOUND;INCLUDEDIR;INCLUDE_DIRS;LDFLAGS;LDFLAGS_OTHER;LIBDIR;LIBRARIES;LIBRARY_DIRS;LIBS;LIBS_L;LIBS_OTHER;LIBS_PATHS;LINK_LIBRARIS;MODULE_NAME;PREFIX;VERSION;STATIC_CFLAGS;STATIC_CFLAGS_I;STATIC_CFLAGS_OTHER;STATIC_INCLUDE_DIRS;STATIC_LDFLAGS;STATIC_LDFLAGS_OTHER;STATIC_LIBDIR;STATIC_LIBRARIES;STATIC_LIBRARY_DIRS;STATIC_LIBS;STATIC_LIBS_L;STATIC_LIBS_OTHER;STATIC_LIBS_PATHS"
|
||||
)
|
||||
foreach(VAR ${VARIABLES})
|
||||
set(KRB5_${VAR} ${KRB5_${MACRO_KRB5_NAME}_${VAR}})
|
||||
endforeach()
|
||||
|
||||
# Bugfix for older installations:
|
||||
# KRB5_INCLUDE_DIRS might not be set, fall back to KRB5_INCLUDEDIR
|
||||
if(NOT KRB5_INCLUDE_DIRS)
|
||||
set(KRB5_INCLUDE_DIRS ${KRB5_INCLUDEDIR})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
function(GET_KRB5_CONFIG KRB5_CONFIG COMMAND RESULT)
|
||||
execute_process(COMMAND ${KRB5_CONFIG} ${COMMAND} OUTPUT_VARIABLE _KRB5_RESULT RESULT_VARIABLE _KRB5_CONFIGURE_FAILED)
|
||||
if(_KRB5_CONFIGURE_FAILED)
|
||||
message(FATAL_ERROR "Failed to detect krb5-config [${COMMAND}]")
|
||||
endif()
|
||||
|
||||
string(REGEX REPLACE "[\r\n]" "" _KRB5_RESULT ${_KRB5_RESULT})
|
||||
set(${RESULT} "${_KRB5_RESULT}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(string_starts_with str search RES)
|
||||
string(FIND "${str}" "${search}" out)
|
||||
if("${out}" EQUAL 0)
|
||||
set(${RES} ON PARENT_SCOPE)
|
||||
else()
|
||||
set(${RES} OFF PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(GET_KRB5_BY_CONFIG KRB5_CONFIG)
|
||||
if(NOT KRB5_CONFIG)
|
||||
find_program(
|
||||
KRB5_CONFIG NAMES "krb5-config" "krb5-config.mit" "krb5-config.heimdal" PATH_SUFFIXES bin
|
||||
NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH REQUIRED
|
||||
)
|
||||
message("autodetected krb5-config at ${KRB5_CONFIG}")
|
||||
if(NOT KRB5_CONFIG)
|
||||
return()
|
||||
endif()
|
||||
else()
|
||||
message("using krb5-config ${KRB5_CONFIG} provided by KRB5_ROOT_CONFIG")
|
||||
endif()
|
||||
|
||||
get_krb5_config("${KRB5_CONFIG}" "--vendor" _KRB5_VENDOR)
|
||||
|
||||
if("${_KRB5_VENDOR}" STREQUAL "Apple MITKerberosShim")
|
||||
message(FATAL_ERROR "Apple MITKerberosShim is deprecated and not supported")
|
||||
elseif("${_KRB5_VENDOR}" STREQUAL "Massachusetts Institute of Technology")
|
||||
set(KRB5_FLAVOUR "MIT")
|
||||
else()
|
||||
set(KRB5_FLAVOUR "${_KRB5_VENDOR}")
|
||||
endif()
|
||||
|
||||
get_krb5_config("${KRB5_CONFIG}" "--cflags" KRB5_CFLAGS)
|
||||
get_krb5_config("${KRB5_CONFIG}" "--version" KRB5_VERSION_RAW)
|
||||
|
||||
string(REGEX REPLACE "[ ]" ";" KRB5_VERSION_LIST "${KRB5_VERSION_RAW}")
|
||||
list(LENGTH KRB5_VERSION_LIST KRB5_VERSION_LIST_LEN)
|
||||
math(EXPR KRB5_VERSION_LIST_LAST "${KRB5_VERSION_LIST_LEN} - 1")
|
||||
list(GET KRB5_VERSION_LIST ${KRB5_VERSION_LIST_LAST} KRB5_VERSION)
|
||||
|
||||
if(KRB5_FLAVOUR STREQUAL "MIT")
|
||||
if(KRB5_VERSION VERSION_LESS "1.14")
|
||||
message(FATAL_ERROR "MIT kerberos ${KRB5_VERSION} < 1.14 is not supported, upgrade the library!")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
get_krb5_config("${KRB5_CONFIG}" "--libs" KRB5_LDFLAGS)
|
||||
|
||||
string(REGEX REPLACE "[ ]" ";" KRB5_CFLAG_LIST "${KRB5_CFLAGS}")
|
||||
foreach(FLAG ${KRB5_CFLAG_LIST})
|
||||
string_starts_with("${FLAG}" "-I" RES)
|
||||
if(RES)
|
||||
string(SUBSTRING "${FLAG}" 2 -1 FLAG)
|
||||
endif()
|
||||
|
||||
if(IS_DIRECTORY "${FLAG}")
|
||||
list(APPEND KRB5_INCLUDEDIR ${FLAG})
|
||||
endif()
|
||||
endforeach()
|
||||
if(NOT KRB5_INCLUDEDIR)
|
||||
find_file(KRB5_INCLUDEDIR_HEADER NAMES krb5.h REQUIRED)
|
||||
get_filename_component(KRB5_INCLUDEDIR "${KRB5_INCLUDEDIR_HEADER}" DIRECTORY)
|
||||
endif()
|
||||
|
||||
string(REGEX REPLACE "[ ]" ";" KRB5_LDFLAG_LIST "${KRB5_LDFLAGS}")
|
||||
foreach(FLAG ${KRB5_LDFLAG_LIST})
|
||||
string_starts_with("${FLAG}" "-L" RES)
|
||||
if(RES)
|
||||
string(SUBSTRING "${FLAG}" 2 -1 SUBFLAG)
|
||||
list(APPEND KRB5_LIBRARY_DIRS ${SUBFLAG})
|
||||
endif()
|
||||
string_starts_with("${FLAG}" "-l" RES)
|
||||
if(RES)
|
||||
string(SUBSTRING "${FLAG}" 2 -1 SUBFLAG)
|
||||
list(APPEND KRB5_LIBRARIES ${SUBFLAG})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set(KRB5_FOUND ON PARENT_SCOPE)
|
||||
set(KRB5_VERSION ${KRB5_VERSION} PARENT_SCOPE)
|
||||
set(KRB5_FLAVOUR ${KRB5_FLAVOUR} PARENT_SCOPE)
|
||||
set(KRB5_CFLAGS ${KRB5_CFLAGS} PARENT_SCOPE)
|
||||
set(KRB5_LDFLAGS ${KRB5_LDFLAGS} PARENT_SCOPE)
|
||||
set(KRB5_INCLUDEDIR ${KRB5_INCLUDEDIR} PARENT_SCOPE)
|
||||
set(KRB5_INCLUDE_DIRS ${KRB5_INCLUDEDIR} PARENT_SCOPE)
|
||||
set(KRB5_LIBRARIES ${KRB5_LIBRARIES} PARENT_SCOPE)
|
||||
set(KRB5_LIBRARY_DIRS ${KRB5_LIBRARY_DIRS} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# try to find kerberos to compile against.
|
||||
#
|
||||
# * First search with pkg-config (prefer MIT over Heimdal)
|
||||
# * Then try to find krb5-config (generic, krb5-config.mit and last krb5-config.heimdal)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
||||
unset(KRB5_MIT_FOUND CACHE)
|
||||
unset(KRB5_HEIMDAL_FOUND CACHE)
|
||||
unset(KRB5_ANY_FOUND CACHE)
|
||||
unset(KRB5_FOUND CACHE)
|
||||
unset(KRB5_VERSION CACHE)
|
||||
unset(KRB5_FLAVOUR CACHE)
|
||||
|
||||
if(KRB5_ROOT_CONFIG)
|
||||
|
||||
elseif(KRB5_ROOT_FLAVOUR)
|
||||
message("krb5: searching with preference for [${KRB5_ROOT_FLAVOUR}]...")
|
||||
if(KRB5_ROOT_FLAVOUR STREQUAL "Heimdal")
|
||||
pkg_check_modules(KRB5_HEIMDAL heimdal-krb5 REQUIRED)
|
||||
elseif(KRB5_ROOT_FLAVOUR STREQUAL "MIT")
|
||||
pkg_check_modules(KRB5_MIT mit-krb5 REQUIRED)
|
||||
else()
|
||||
message(FATAL_ERROR "Invalid KRB5_ROOT_FLAVOUR=${KRB5_ROOT_FLAVOUR}, only 'MIT' or 'Heimdal' are supported")
|
||||
endif()
|
||||
else()
|
||||
message("krb5: searching without preference...")
|
||||
pkg_check_modules(KRB5_MIT mit-krb5)
|
||||
pkg_check_modules(KRB5_HEIMDAL heimdal-krb5)
|
||||
endif()
|
||||
|
||||
if(KRB5_MIT_FOUND)
|
||||
provides_krb5(NAME "MIT")
|
||||
if(KRB5_VERSION VERSION_LESS "1.14")
|
||||
message(FATAL_ERROR "MIT kerberos < 1.14 is not supported, upgrade the library!")
|
||||
endif()
|
||||
elseif(KRB5_HEIMDAL_FOUND)
|
||||
provides_krb5(NAME "Heimdal")
|
||||
elseif(KRB5_ANY_FOUND)
|
||||
get_krb5_vendor(ANY_VENDOR)
|
||||
provides_krb5(NAME "${ANY_VENDOR}")
|
||||
else()
|
||||
get_krb5_by_config("${KRB5_ROOT_CONFIG}")
|
||||
endif()
|
||||
|
||||
message("using KRB5_FOUND ${KRB5_FOUND} ")
|
||||
message("using KRB5_VERSION ${KRB5_VERSION} ")
|
||||
message("using KRB5_FLAVOUR ${KRB5_FLAVOUR} ")
|
||||
message("using KRB5_CFLAGS ${KRB5_CFLAGS} ")
|
||||
message("using KRB5_LDFLAGS ${KRB5_LDFLAGS} ")
|
||||
message("using KRB5_INCLUDEDIR ${KRB5_INCLUDEDIR} ")
|
||||
message("using KRB5_INCLUDE_DIRS ${KRB5_INCLUDE_DIRS} ")
|
||||
message("using KRB5_LIBRARIES ${KRB5_LIBRARIES} ")
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(
|
||||
KRB5 REQUIRED_VARS ${_KRB5_REQUIRED_VARS} VERSION_VAR KRB5_VERSION
|
||||
FAIL_MESSAGE "Could NOT find Kerberos, try to set the CMake variable KRB5_ROOT_CONFIG to the full path of krb5-config"
|
||||
)
|
||||
|
||||
mark_as_advanced(${_KRB5_REQUIRED_VARS})
|
||||
12
third_party/FreeRDP/cmake/FindLAME.cmake
vendored
Normal file
12
third_party/FreeRDP/cmake/FindLAME.cmake
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
find_path(LAME_INCLUDE_DIR lame/lame.h)
|
||||
|
||||
find_library(LAME_LIBRARY NAMES lame mp3lame)
|
||||
|
||||
find_package_handle_standard_args(LAME DEFAULT_MSG LAME_INCLUDE_DIR LAME_LIBRARY)
|
||||
|
||||
if(LAME_FOUND)
|
||||
set(LAME_LIBRARIES ${LAME_LIBRARY})
|
||||
set(LAME_INCLUDE_DIRS ${LAME_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(LAME_INCLUDE_DIR LAME_LIBRARY)
|
||||
24
third_party/FreeRDP/cmake/FindMbedTLS.cmake
vendored
Normal file
24
third_party/FreeRDP/cmake/FindMbedTLS.cmake
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
find_path(MBEDTLS_INCLUDE_DIR NAMES mbedtls/ssl.h PATH_SUFFIXES include HINTS ${MBEDTLS_ROOT})
|
||||
|
||||
find_library(MBEDTLS_LIBRARY NAMES mbedtls PATH_SUFFIXES lib HINTS ${MBEDTLS_ROOT})
|
||||
|
||||
find_library(MBEDCRYPTO_LIBRARY NAMES mbedcrypto PATH_SUFFIXES lib HINTS ${MBEDTLS_ROOT})
|
||||
|
||||
find_library(MBEDX509_LIBRARY NAMES mbedx509 PATH_SUFFIXES lib HINTS ${MBEDTLS_ROOT})
|
||||
|
||||
if(MBEDTLS_INCLUDE_DIR AND MBEDTLS_LIBRARY)
|
||||
set(MBEDTLS_FOUND TRUE)
|
||||
set(MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARY} ${MBEDCRYPTO_LIBRARY} ${MBEDX509_LIBRARY})
|
||||
endif()
|
||||
|
||||
if(MBEDTLS_FOUND)
|
||||
if(NOT MBEDTLS_FIND_QUIETLY)
|
||||
message(STATUS "Found mbed TLS: ${MBEDTLS_LIBRARIES}")
|
||||
endif()
|
||||
else()
|
||||
if(MBEDTLS_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "mbed TLS was not found")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced(MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY)
|
||||
34
third_party/FreeRDP/cmake/FindOSS.cmake
vendored
Normal file
34
third_party/FreeRDP/cmake/FindOSS.cmake
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
#
|
||||
# Find OSS include header for Unix platforms.
|
||||
# used by FQTerm to detect the availability of OSS.
|
||||
|
||||
if(UNIX)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
set(PLATFORM_PREFIX "linux/")
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||
set(PLATFORM_PREFIX "sys/")
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
|
||||
set(PLATFORM_PREFIX "machine/")
|
||||
endif()
|
||||
endif(UNIX)
|
||||
|
||||
set(OSS_HDR_NAME "${PLATFORM_PREFIX}soundcard.h" CACHE STRING "oss header include file name")
|
||||
find_path(OSS_INCLUDE_DIRS ${OSS_HDR_NAME} PATHS "/usr/local/include" PATH_SUFFIXES ${PLATFORM_SUFFIX})
|
||||
|
||||
if(OSS_INCLUDE_DIRS)
|
||||
set(OSS_FOUND ON CACHE BOOL "oss detection status")
|
||||
else(OSS_INCLUDE_DIRS)
|
||||
set(OSS_FOUND OFF CACHE BOOL "oss detection status")
|
||||
endif(OSS_INCLUDE_DIRS)
|
||||
|
||||
if(OSS_FOUND)
|
||||
message(STATUS "Found OSS Audio")
|
||||
else(OSS_FOUND)
|
||||
if(OSS_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "FAILED to found Audio - REQUIRED")
|
||||
else(OSS_FIND_REQUIRED)
|
||||
message(STATUS "Audio Disabled")
|
||||
endif(OSS_FIND_REQUIRED)
|
||||
endif(OSS_FOUND)
|
||||
|
||||
mark_as_advanced(OSS_FOUND OSS_HDR_NAME OSS_INCLUDE_DIRS)
|
||||
45
third_party/FreeRDP/cmake/FindOpenH264.cmake
vendored
Normal file
45
third_party/FreeRDP/cmake/FindOpenH264.cmake
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
# - Try to find the OpenH264 library
|
||||
# Once done this will define
|
||||
#
|
||||
# OPENH264_ROOT - A list of search hints
|
||||
#
|
||||
# OPENH264_FOUND - system has OpenH264
|
||||
# OPENH264_INCLUDE_DIR - the OpenH264 include directory
|
||||
# OPENH264_LIBRARIES - libopenh264 library
|
||||
|
||||
if(UNIX AND NOT ANDROID)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_OPENH264 QUIET openh264)
|
||||
endif(UNIX AND NOT ANDROID)
|
||||
|
||||
if(OPENH264_INCLUDE_DIR AND OPENH264_LIBRARY)
|
||||
set(OPENH264_FIND_QUIETLY TRUE)
|
||||
endif(OPENH264_INCLUDE_DIR AND OPENH264_LIBRARY)
|
||||
|
||||
find_path(OPENH264_INCLUDE_DIR NAMES wels/codec_api.h wels/codec_app_def.h wels/codec_def.h PATH_SUFFIXES include
|
||||
HINTS ${OPENH264_ROOT} ${PC_OPENH264_INCLUDE_DIRS}
|
||||
)
|
||||
find_library(
|
||||
OPENH264_LIBRARY NAMES openh264_dll openh264 welsdec PATH_SUFFIXES lib HINTS ${OPENH264_ROOT}
|
||||
${PC_OPENH264_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(OpenH264 DEFAULT_MSG OPENH264_LIBRARY OPENH264_INCLUDE_DIR)
|
||||
|
||||
if(OPENH264_INCLUDE_DIR AND OPENH264_LIBRARY)
|
||||
set(OPENH264_FOUND TRUE)
|
||||
set(OPENH264_LIBRARIES ${OPENH264_LIBRARY})
|
||||
endif(OPENH264_INCLUDE_DIR AND OPENH264_LIBRARY)
|
||||
|
||||
if(OPENH264_FOUND)
|
||||
if(NOT OPENH264_FIND_QUIETLY)
|
||||
message(STATUS "Found OpenH264: ${OPENH264_LIBRARIES}")
|
||||
endif(NOT OPENH264_FIND_QUIETLY)
|
||||
else(OPENH264_FOUND)
|
||||
if(OPENH264_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "OpenH264 was not found")
|
||||
endif(OPENH264_FIND_REQUIRED)
|
||||
endif(OPENH264_FOUND)
|
||||
|
||||
mark_as_advanced(OPENH264_INCLUDE_DIR OPENH264_LIBRARY)
|
||||
29
third_party/FreeRDP/cmake/FindOpenSLES.cmake
vendored
Normal file
29
third_party/FreeRDP/cmake/FindOpenSLES.cmake
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
# - Find OpenSLES
|
||||
# Find the OpenSLES includes and libraries
|
||||
#
|
||||
# OpenSLES_INCLUDE_DIR - where to find dsound.h
|
||||
# OpenSLES_LIBRARIES - List of libraries when using dsound.
|
||||
# OpenSLES_FOUND - True if dsound found.
|
||||
|
||||
get_property(_FIND_LIBRARY_USE_LIB64_PATHS GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
|
||||
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS 1)
|
||||
|
||||
find_path(OpenSLES_INCLUDE_DIR SLES/OpenSLES.h)
|
||||
|
||||
find_library(OpenSLES_LIBRARY NAMES OpenSLES)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(OpenSLES DEFAULT_MSG OpenSLES_INCLUDE_DIR OpenSLES_LIBRARY)
|
||||
|
||||
if(OpenSLES_FOUND)
|
||||
set(OpenSLES_INCLUDE_DIRS ${OpenSLES_INCLUDE_DIR})
|
||||
set(OpenSLES_LIBRARIES ${OpenSLES_LIBRARY})
|
||||
else(OpenSLES_FOUND)
|
||||
if(OpenSLES_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could NOT find OpenSLES")
|
||||
endif()
|
||||
endif(OpenSLES_FOUND)
|
||||
|
||||
mark_as_advanced(OpenSLES_INCLUDE_DIR OpenSLES_LIBRARY)
|
||||
|
||||
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ${_FIND_LIBRARY_USE_LIB64_PATHS})
|
||||
39
third_party/FreeRDP/cmake/FindPAM.cmake
vendored
Normal file
39
third_party/FreeRDP/cmake/FindPAM.cmake
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
# - Try to find the PAM libraries
|
||||
# Once done this will define
|
||||
#
|
||||
# PAM_FOUND - system has pam
|
||||
# PAM_INCLUDE_DIR - the pam include directory
|
||||
# PAM_LIBRARIES - libpam library
|
||||
|
||||
if(PAM_INCLUDE_DIR AND PAM_LIBRARY)
|
||||
set(PAM_FIND_QUIETLY TRUE)
|
||||
endif(PAM_INCLUDE_DIR AND PAM_LIBRARY)
|
||||
|
||||
find_path(PAM_INCLUDE_DIR NAMES security/pam_appl.h pam/pam_appl.h)
|
||||
find_library(PAM_LIBRARY pam)
|
||||
find_library(DL_LIBRARY dl)
|
||||
|
||||
if(PAM_INCLUDE_DIR AND PAM_LIBRARY)
|
||||
set(PAM_FOUND TRUE)
|
||||
if(DL_LIBRARY)
|
||||
set(PAM_LIBRARIES ${PAM_LIBRARY} ${DL_LIBRARY})
|
||||
else(DL_LIBRARY)
|
||||
set(PAM_LIBRARIES ${PAM_LIBRARY})
|
||||
endif(DL_LIBRARY)
|
||||
|
||||
if(EXISTS ${PAM_INCLUDE_DIR}/pam/pam_appl.h)
|
||||
set(HAVE_PAM_PAM_APPL_H 1)
|
||||
endif(EXISTS ${PAM_INCLUDE_DIR}/pam/pam_appl.h)
|
||||
endif(PAM_INCLUDE_DIR AND PAM_LIBRARY)
|
||||
|
||||
if(PAM_FOUND)
|
||||
if(NOT PAM_FIND_QUIETLY)
|
||||
message(STATUS "Found PAM: ${PAM_LIBRARIES}")
|
||||
endif(NOT PAM_FIND_QUIETLY)
|
||||
else(PAM_FOUND)
|
||||
if(PAM_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "PAM was not found")
|
||||
endif(PAM_FIND_REQUIRED)
|
||||
endif(PAM_FOUND)
|
||||
|
||||
mark_as_advanced(PAM_INCLUDE_DIR PAM_LIBRARY DL_LIBRARY)
|
||||
23
third_party/FreeRDP/cmake/FindPCSC.cmake
vendored
Normal file
23
third_party/FreeRDP/cmake/FindPCSC.cmake
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
# - Try to find PCSC
|
||||
# Once done this will define
|
||||
# PCSC_FOUND - pcsc was found
|
||||
# PCSC_INCLUDE_DIRS - pcsc include directories
|
||||
# PCSC_LIBRARIES - libraries needed for linking
|
||||
|
||||
find_package(PkgConfig)
|
||||
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PC_PCSC QUIET libpcsclite)
|
||||
endif()
|
||||
|
||||
find_path(PCSC_INCLUDE_DIR pcsclite.h WinSCard.h HINTS ${PC_PCSC_INCLUDEDIR} ${PC_PCSC_INCLUDE_DIRS} PATH_SUFFIXES PCSC)
|
||||
|
||||
find_library(PCSC_LIBRARY NAMES PCSC WinSCard pcsclite HINTS ${PC_PCSC_LIBDIR} ${PC_PCSC_LIBRARY_DIRS})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(PCSC DEFAULT_MSG PCSC_LIBRARY PCSC_INCLUDE_DIR)
|
||||
|
||||
set(PCSC_LIBRARIES ${PCSC_LIBRARY})
|
||||
set(PCSC_INCLUDE_DIRS ${PCSC_INCLUDE_DIR})
|
||||
|
||||
mark_as_advanced(PCSC_INCLUDE_DIR PCSC_LIBRARY)
|
||||
8
third_party/FreeRDP/cmake/FindPCSCWinPR.cmake
vendored
Normal file
8
third_party/FreeRDP/cmake/FindPCSCWinPR.cmake
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
find_library(PCSC_WINPR_LIBRARY NAMES libpcsc-winpr.a PATHS /opt/lib /usr/lib /usr/local/lib)
|
||||
|
||||
if(NOT ${PCSC_WINPR_LIBRARY} MATCHES ".*-NOTFOUND")
|
||||
set(PCSC_WINPR_FOUND 1)
|
||||
message(STATUS "Found PCSC-WinPR: ${PCSC_WINPR_LIBRARY}")
|
||||
endif()
|
||||
|
||||
mark_as_advanced(PCSC_WINPR_LIBRARY)
|
||||
41
third_party/FreeRDP/cmake/FindPixman.cmake
vendored
Normal file
41
third_party/FreeRDP/cmake/FindPixman.cmake
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
# - Find Pixman
|
||||
# Find the Pixman libraries
|
||||
#
|
||||
# This module defines the following variables:
|
||||
# PIXMAN_FOUND - true if PIXMAN_INCLUDE_DIR & PIXMAN_LIBRARY are found
|
||||
# PIXMAN_LIBRARIES - Set when PIXMAN_LIBRARY is found
|
||||
# PIXMAN_INCLUDE_DIRS - Set when PIXMAN_INCLUDE_DIR is found
|
||||
#
|
||||
# PIXMAN_INCLUDE_DIR - where to find pixman.h, etc.
|
||||
# PIXMAN_LIBRARY - the Pixman library
|
||||
#
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2013 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.
|
||||
#=============================================================================
|
||||
|
||||
find_path(PIXMAN_INCLUDE_DIR NAMES pixman.h PATH_SUFFIXES pixman-1)
|
||||
|
||||
find_library(PIXMAN_LIBRARY NAMES pixman-1)
|
||||
|
||||
find_package_handle_standard_args(Pixman DEFAULT_MSG PIXMAN_LIBRARY PIXMAN_INCLUDE_DIR)
|
||||
|
||||
if(Pixman_FOUND)
|
||||
set(PIXMAN_FOUND ON)
|
||||
set(PIXMAN_LIBRARIES ${PIXMAN_LIBRARY})
|
||||
set(PIXMAN_INCLUDE_DIRS ${PIXMAN_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(PIXMAN_INCLUDE_DIR PIXMAN_LIBRARY)
|
||||
62
third_party/FreeRDP/cmake/FindSSO_MIB.cmake
vendored
Normal file
62
third_party/FreeRDP/cmake/FindSSO_MIB.cmake
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
# - Find sso-mib
|
||||
# Find the sso-mib library
|
||||
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright 2025 Siemens
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(PC_SSO_MIB sso-mib>=0.5.0)
|
||||
|
||||
if(PC_SSO_MIB_FOUND)
|
||||
find_path(SSO_MIB_INCLUDE_DIR NAMES sso-mib/sso-mib.h HINTS ${PC_SSO_MIB_INCLUDEDIR})
|
||||
find_library(SSO_MIB_LIBRARY NAMES sso-mib HINTS ${PC_SSO_MIB_LIBRARYDIR})
|
||||
|
||||
find_package_handle_standard_args(SSO_MIB DEFAULT_MSG SSO_MIB_LIBRARY SSO_MIB_INCLUDE_DIR)
|
||||
|
||||
if(SSO_MIB_FOUND)
|
||||
set(SSO_MIB_LIBRARIES ${SSO_MIB_LIBRARY} ${PC_SSO_MIB_LIBRARIES})
|
||||
set(SSO_MIB_INCLUDE_DIRS ${SSO_MIB_INCLUDE_DIR} ${PC_SSO_MIB_INCLUDE_DIRS})
|
||||
endif()
|
||||
else()
|
||||
include(ExternalProject)
|
||||
set(SSO_MIB_EXTERNAL_DIR ${CMAKE_BINARY_DIR}/sso-mib-external)
|
||||
|
||||
set(SSO_MIB_URL https://github.com/siemens/sso-mib.git)
|
||||
set(SSO_MIB_VERSION_MAJOR 0)
|
||||
set(SSO_MIB_VERSION_MINOR 5)
|
||||
set(SSO_MIB_VERSION_PATCH 0)
|
||||
set(SSO_MIB_VERSION v${SSO_MIB_VERSION_MAJOR}.${SSO_MIB_VERSION_MINOR}.${SSO_MIB_VERSION_PATCH})
|
||||
message(STATUS "Adding sso-mib as ExternalProject from ${SSO_MIB_URL}, version ${SSO_MIB_VERSION}")
|
||||
|
||||
ExternalProject_Add(
|
||||
sso-mib-external GIT_REPOSITORY ${SSO_MIB_URL} GIT_TAG ${SSO_MIB_VERSION} PREFIX ${SSO_MIB_EXTERNAL_DIR}
|
||||
SOURCE_DIR ${SSO_MIB_EXTERNAL_DIR}/src BINARY_DIR ${SSO_MIB_EXTERNAL_DIR}/build TMP_DIR _deps/tmp
|
||||
STAMP_DIR _deps/stamp CONFIGURE_COMMAND meson setup --prefix=${SSO_MIB_EXTERNAL_DIR}/install --libdir=lib/
|
||||
${SSO_MIB_EXTERNAL_DIR}/build ${SSO_MIB_EXTERNAL_DIR}/src
|
||||
BUILD_COMMAND meson compile -C ${SSO_MIB_EXTERNAL_DIR}/build INSTALL_COMMAND meson install -C
|
||||
${SSO_MIB_EXTERNAL_DIR}/build
|
||||
UPDATE_COMMAND "" BUILD_BYPRODUCTS ${SSO_MIB_EXTERNAL_DIR}/install/lib/libsso-mib.so
|
||||
)
|
||||
|
||||
# Dependencies
|
||||
pkg_check_modules(GLIB REQUIRED glib-2.0)
|
||||
pkg_check_modules(GIO REQUIRED gio-2.0)
|
||||
pkg_check_modules(JSON_GLIB REQUIRED json-glib-1.0)
|
||||
pkg_check_modules(UUID REQUIRED uuid)
|
||||
if(GLIB_FOUND AND GIO_FOUND AND JSON_GLIB_FOUND AND UUID_FOUND)
|
||||
set(PC_SSO_MIB_INCLUDE_DIRS ${GLIB_INCLUDE_DIRS} ${GIO_INCLUDE_DIRS} ${JSON_GLIB_INCLUDE_DIRS} ${UUID_INCLUDE_DIRS})
|
||||
set(PC_SSO_MIB_LIBRARIES ${GLIB_LIBRARIES} ${GIO_LIBRARIES} ${JSON_GLIB_LIBRARIES} ${UUID_LIBRARIES})
|
||||
endif()
|
||||
|
||||
set(SSO_MIB_INCLUDE_DIRS ${SSO_MIB_EXTERNAL_DIR}/install/include ${PC_SSO_MIB_INCLUDE_DIRS})
|
||||
set(SSO_MIB_LIBRARIES ${SSO_MIB_EXTERNAL_DIR}/install/lib/libsso-mib.so ${PC_SSO_MIB_LIBRARIES})
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set(SSO_MIB_INSTALL_LIBRARIES
|
||||
${SSO_MIB_EXTERNAL_DIR}/install/lib/libsso-mib.so
|
||||
${SSO_MIB_EXTERNAL_DIR}/install/lib/libsso-mib.so.${SSO_MIB_VERSION_MAJOR}
|
||||
${SSO_MIB_EXTERNAL_DIR}/install/lib/libsso-mib.so.${SSO_MIB_VERSION_MAJOR}.${SSO_MIB_VERSION_MINOR}.${SSO_MIB_VERSION_PATCH}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced(SSO_MIB_INCLUDE_DIR SSO_MIB_LIBRARY)
|
||||
9
third_party/FreeRDP/cmake/FindV4L.cmake
vendored
Normal file
9
third_party/FreeRDP/cmake/FindV4L.cmake
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
find_path(V4L_INCLUDE_DIR NAMES linux/videodev2.h)
|
||||
|
||||
find_package_handle_standard_args(V4L DEFAULT_MSG V4L_INCLUDE_DIR)
|
||||
|
||||
if(V4L_FOUND)
|
||||
set(V4L_INCLUDE_DIRS ${V4L_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(V4L_INCLUDE_DIR)
|
||||
68
third_party/FreeRDP/cmake/FindWayland.cmake
vendored
Normal file
68
third_party/FreeRDP/cmake/FindWayland.cmake
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
# - Finds Wayland
|
||||
# Find the Wayland libraries that are needed for UWAC
|
||||
#
|
||||
# This module defines the following variables:
|
||||
# WAYLAND_FOUND - true if UWAC has been found
|
||||
# WAYLAND_LIBS - Set to the full path to wayland client libraries
|
||||
# WAYLAND_INCLUDE_DIR - Set to the include directories for wayland
|
||||
# XKBCOMMON_LIBS - Set to the full path to xkbcommon libraries
|
||||
# XKBCOMMON_INCLUDE_DIR - Set to the include directories for xkbcommon
|
||||
#
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2015 David Fort <contact@hardening-consulting.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.
|
||||
#=============================================================================
|
||||
|
||||
find_package(PkgConfig)
|
||||
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(WAYLAND_SCANNER_PC wayland-scanner)
|
||||
pkg_check_modules(WAYLAND_CLIENT_PC wayland-client)
|
||||
pkg_check_modules(WAYLAND_CURSOR_PC wayland-cursor)
|
||||
pkg_check_modules(XKBCOMMON_PC xkbcommon)
|
||||
endif()
|
||||
|
||||
find_program(WAYLAND_SCANNER wayland-scanner HINTS "${WAYLAND_SCANNER_PC_PREFIX}/bin")
|
||||
|
||||
find_path(WAYLAND_INCLUDE_DIR wayland-client.h HINTS ${WAYLAND_CLIENT_PC_INCLUDE_DIRS})
|
||||
|
||||
find_library(WAYLAND_CLIENT_LIB NAMES "wayland-client" HINTS "${WAYLAND_CLIENT_PC_LIBRARY_DIRS}")
|
||||
|
||||
find_library(WAYLAND_CURSOR_LIB NAMES "wayland-cursor" HINTS "${WAYLAND_CURSOR_PC_LIBRARY_DIRS}")
|
||||
|
||||
if(WAYLAND_CLIENT_LIB AND WAYLAND_CURSOR_LIB)
|
||||
list(APPEND WAYLAND_LIBS ${WAYLAND_CLIENT_LIB} ${WAYLAND_CURSOR_LIB})
|
||||
endif(WAYLAND_CLIENT_LIB AND WAYLAND_CURSOR_LIB)
|
||||
|
||||
find_path(XKBCOMMON_INCLUDE_DIR xkbcommon/xkbcommon.h HINTS ${XKBCOMMON_PC_INCLUDE_DIRS})
|
||||
|
||||
find_library(XKBCOMMON_LIBS NAMES xkbcommon HINTS "${XKBCOMMON_PC_LIBRARY_DIRS}")
|
||||
|
||||
set(Wayland_SCANNER ${WAYLAND_SCANNER})
|
||||
set(Wayland_INCLUDE_DIR ${WAYLAND_INCLUDE_DIR})
|
||||
set(Wayland_LIBS ${WAYLAND_LIBS})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(
|
||||
Wayland
|
||||
DEFAULT_MSG
|
||||
Wayland_SCANNER
|
||||
Wayland_INCLUDE_DIR
|
||||
Wayland_LIBS
|
||||
XKBCOMMON_INCLUDE_DIR
|
||||
XKBCOMMON_LIBS
|
||||
)
|
||||
|
||||
set(WAYLAND_FOUND ${Wayland_FOUND})
|
||||
37
third_party/FreeRDP/cmake/Findlibsystemd.cmake
vendored
Normal file
37
third_party/FreeRDP/cmake/Findlibsystemd.cmake
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
# Module defines
|
||||
# LIBSYSTEMD_FOUND - libsystemd libraries and includes found
|
||||
# LIBSYSTEMD_INCLUDE_DIRS - the libsystemd include directories
|
||||
# LIBSYSTEMD_LIBRARIES - the libsystemd libraries
|
||||
#
|
||||
# Cache entries:
|
||||
# LIBSYSTEMD_LIBRARY - detected libsystemd library
|
||||
# LIBSYSTEMD_INCLUDE_DIR - detected libsystemd include dir(s)
|
||||
#
|
||||
|
||||
if(LIBSYSTEMD_INCLUDE_DIR AND LIBSYSTEMD_LIBRARY)
|
||||
# in cache already
|
||||
set(LIBSYSTEMD_FOUND TRUE)
|
||||
set(LIBSYSTEMD_LIBRARIES ${LIBSYSTEMD_LIBRARY})
|
||||
set(LIBSYSTEMD_INCLUDE_DIRS ${LIBSYSTEMD_INCLUDE_DIR})
|
||||
else()
|
||||
|
||||
find_package(PkgConfig)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_LIBSYSTEMD_PC QUIET "libsystemd")
|
||||
endif(PKG_CONFIG_FOUND)
|
||||
|
||||
find_path(LIBSYSTEMD_INCLUDE_DIR systemd/sd-journal.h ${_LIBSYSTEMD_PC_INCLUDE_DIRS} /usr/include /usr/local/include)
|
||||
mark_as_advanced(LIBSYSTEMD_INCLUDE_DIR)
|
||||
|
||||
find_library(LIBSYSTEMD_LIBRARY NAMES systemd PATHS ${_LIBSYSTEMD_PC_LIBDIR})
|
||||
mark_as_advanced(LIBSYSTEMD_LIBRARY)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(libsystemd DEFAULT_MSG LIBSYSTEMD_LIBRARY LIBSYSTEMD_INCLUDE_DIR)
|
||||
|
||||
if(libsystemd_FOUND)
|
||||
set(LIBSYSTEMD_LIBRARIES ${LIBSYSTEMD_LIBRARY})
|
||||
set(LIBSYSTEMD_INCLUDE_DIRS ${LIBSYSTEMD_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
endif()
|
||||
77
third_party/FreeRDP/cmake/Findlibusb-1.0.cmake
vendored
Normal file
77
third_party/FreeRDP/cmake/Findlibusb-1.0.cmake
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
# - Try to find libusb-1.0
|
||||
# Once done this will define
|
||||
#
|
||||
# LIBUSB_1_FOUND - system has libusb
|
||||
# LIBUSB_1_INCLUDE_DIRS - the libusb include directory
|
||||
# LIBUSB_1_LIBRARIES - Link these to use libusb
|
||||
# LIBUSB_1_DEFINITIONS - Compiler switches required for using libusb
|
||||
#
|
||||
# Adapted from cmake-modules Google Code project
|
||||
#
|
||||
# Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
|
||||
#
|
||||
# (Changes for libusb) Copyright (c) 2008 Kyle Machulis <kyle@nonpolynomial.com>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the New BSD license.
|
||||
#
|
||||
# CMake-Modules Project New BSD License
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this
|
||||
# list of conditions and the following disclaimer.
|
||||
#
|
||||
# * Redistributions in binary form must reproduce the above copyright notice,
|
||||
# this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# * Neither the name of the CMake-Modules Project nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from this
|
||||
# software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
if(LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
|
||||
# in cache already
|
||||
set(LIBUSB_FOUND TRUE)
|
||||
else(LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
|
||||
find_path(LIBUSB_1_INCLUDE_DIR NAMES libusb.h PATHS /usr/include /usr/local/include /sw/include
|
||||
PATH_SUFFIXES libusb-1.0
|
||||
)
|
||||
|
||||
find_library(LIBUSB_1_LIBRARY NAMES libusb-1.0 usb-1.0 usb PATHS /usr/lib /usr/local/lib /sw/lib)
|
||||
|
||||
set(LIBUSB_1_INCLUDE_DIRS ${LIBUSB_1_INCLUDE_DIR})
|
||||
set(LIBUSB_1_LIBRARIES ${LIBUSB_1_LIBRARY})
|
||||
|
||||
if(LIBUSB_1_INCLUDE_DIRS AND LIBUSB_1_LIBRARIES)
|
||||
set(LIBUSB_1_FOUND TRUE)
|
||||
endif(LIBUSB_1_INCLUDE_DIRS AND LIBUSB_1_LIBRARIES)
|
||||
|
||||
if(LIBUSB_1_FOUND)
|
||||
if(NOT libusb_1_FIND_QUIETLY)
|
||||
message(STATUS "Found libusb-1.0:")
|
||||
message(STATUS " - Includes: ${LIBUSB_1_INCLUDE_DIRS}")
|
||||
message(STATUS " - Libraries: ${LIBUSB_1_LIBRARIES}")
|
||||
endif(NOT libusb_1_FIND_QUIETLY)
|
||||
else(LIBUSB_1_FOUND)
|
||||
if(libusb_1_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find libusb")
|
||||
endif(libusb_1_FIND_REQUIRED)
|
||||
endif(LIBUSB_1_FOUND)
|
||||
|
||||
# show the LIBUSB_1_INCLUDE_DIRS and LIBUSB_1_LIBRARIES variables only in the advanced view
|
||||
mark_as_advanced(LIBUSB_1_INCLUDE_DIRS LIBUSB_1_LIBRARIES)
|
||||
|
||||
endif(LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
|
||||
17
third_party/FreeRDP/cmake/Findlodepng.cmake
vendored
Normal file
17
third_party/FreeRDP/cmake/Findlodepng.cmake
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
# - Try to find lodepng
|
||||
# Once done this will define
|
||||
# lodepng_FOUND - lodepng was found
|
||||
# lodepng_INCLUDE_DIRS - lodepng include directories
|
||||
# lodepng_LIBRARIES - lodepng libraries for linking
|
||||
|
||||
find_path(lodepng_INCLUDE_DIR NAMES lodepng.h)
|
||||
|
||||
find_library(lodepng_LIBRARY NAMES lodepng)
|
||||
|
||||
if(lodepng_INCLUDE_DIR AND lodepng_LIBRARY)
|
||||
set(lodepng_FOUND ON)
|
||||
set(lodepng_INCLUDE_DIRS ${lodepng_INCLUDE_DIR})
|
||||
set(lodepng_LIBRARIES ${lodepng_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(lodepng_INCLUDE_DIRS lodepng_LIBRARIES)
|
||||
56
third_party/FreeRDP/cmake/Findsoxr.cmake
vendored
Normal file
56
third_party/FreeRDP/cmake/Findsoxr.cmake
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
# Try to find the soxr library
|
||||
#
|
||||
# Copyright 2018 Thincast Technologies GmbH
|
||||
# Copyright 2018 Armin Novak <armin.novak@thincast.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
|
||||
#
|
||||
# Once done this will define
|
||||
#
|
||||
# SOXR_ROOT - A list of search hints
|
||||
#
|
||||
# SOXR_FOUND - system has soxr
|
||||
# SOXR_INCLUDE_DIR - the soxr include directory
|
||||
# SOXR_LIBRARIES - libsoxr library
|
||||
|
||||
if(UNIX AND NOT ANDROID)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_SOXR QUIET soxr)
|
||||
endif(UNIX AND NOT ANDROID)
|
||||
|
||||
if(SOXR_INCLUDE_DIR AND SOXR_LIBRARY)
|
||||
set(SOXR_FIND_QUIETLY TRUE)
|
||||
endif(SOXR_INCLUDE_DIR AND SOXR_LIBRARY)
|
||||
|
||||
find_path(SOXR_INCLUDE_DIR NAMES soxr.h PATH_SUFFIXES include HINTS ${SOXR_ROOT} ${PC_SOXR_INCLUDE_DIRS})
|
||||
find_library(SOXR_LIBRARY NAMES soxr PATH_SUFFIXES lib HINTS ${SOXR_ROOT} ${PC_SOXR_LIBRARY_DIRS})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(soxr DEFAULT_MSG SOXR_LIBRARY SOXR_INCLUDE_DIR)
|
||||
|
||||
if(SOXR_INCLUDE_DIR AND SOXR_LIBRARY)
|
||||
set(SOXR_FOUND TRUE)
|
||||
set(SOXR_INCLUDE_DIRS ${SOXR_INCLUDE_DIR})
|
||||
set(SOXR_LIBRARIES ${SOXR_LIBRARY})
|
||||
endif(SOXR_INCLUDE_DIR AND SOXR_LIBRARY)
|
||||
|
||||
if(SOXR_FOUND)
|
||||
if(NOT SOXR_FIND_QUIETLY)
|
||||
message(STATUS "Found soxr: ${SOXR_LIBRARIES}")
|
||||
endif(NOT SOXR_FIND_QUIETLY)
|
||||
else(SOXR_FOUND)
|
||||
if(SOXR_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "soxr was not found")
|
||||
endif(SOXR_FIND_REQUIRED)
|
||||
endif(SOXR_FOUND)
|
||||
|
||||
mark_as_advanced(SOXR_INCLUDE_DIR SOXR_LIBRARY)
|
||||
21
third_party/FreeRDP/cmake/GNUInstallDirsWrapper.cmake
vendored
Normal file
21
third_party/FreeRDP/cmake/GNUInstallDirsWrapper.cmake
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# GNUInstallDirs is a relatively new cmake module, so wrap it to avoid errors
|
||||
include(GNUInstallDirs OPTIONAL RESULT_VARIABLE GID_PATH)
|
||||
if(GID_PATH STREQUAL "NOTFOUND")
|
||||
if(NOT DEFINED CMAKE_INSTALL_BINDIR)
|
||||
set(CMAKE_INSTALL_BINDIR "bin" CACHE PATH "user executables (bin)")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
|
||||
set(CMAKE_INSTALL_LIBDIR "lib${LIB_SUFFIX}" CACHE PATH "object code libraries (lib)")
|
||||
endif()
|
||||
|
||||
foreach(dir BINDIR LIBDIR)
|
||||
if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_${dir}})
|
||||
set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_${dir}}")
|
||||
else()
|
||||
set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_${dir}}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
mark_as_advanced(CMAKE_INSTALL_BINDIR CMAKE_INSTALL_LIBDIR)
|
||||
endif()
|
||||
46
third_party/FreeRDP/cmake/GenerateManpages.cmake
vendored
Normal file
46
third_party/FreeRDP/cmake/GenerateManpages.cmake
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
get_filename_component(GENERATE_MANPAGES_SCRIPT_DIR "${CMAKE_CURRENT_LIST_DIR}" ABSOLUTE)
|
||||
list(APPEND CMAKE_MODULE_PATH ${GENERATE_MANPAGES_SCRIPT_DIR})
|
||||
|
||||
set(SRC "${CURRENT_SOURCE_DIR}/${target}.${section}.in")
|
||||
configure_file(${SRC} ${manpage}.tmp @ONLY IMMEDIATE)
|
||||
|
||||
# write header (aka name of the manpage), truncate existing
|
||||
file(READ ${CURRENT_BINARY_DIR}/${manpage}.tmp CONTENTS)
|
||||
file(WRITE ${CURRENT_BINARY_DIR}/${manpage} "${CONTENTS}")
|
||||
|
||||
string(REPLACE " " ";" DEPS ${dependencies})
|
||||
foreach(DEP IN LISTS DEPS)
|
||||
get_filename_component(DNAME "${DEP}" NAME)
|
||||
set(SRC_IN ${CURRENT_SOURCE_DIR}/${DEP}.in)
|
||||
set(DST_IN ${CURRENT_BINARY_DIR}/${DEP}.in)
|
||||
set(SRC ${CURRENT_SOURCE_DIR}/${DEP})
|
||||
set(BIN ${CURRENT_BINARY_DIR}/${DEP})
|
||||
set(DST ${CURRENT_BINARY_DIR}/${DNAME})
|
||||
|
||||
if(EXISTS ${SRC_IN})
|
||||
message("using generated ${DST} from ${SRC_IN}")
|
||||
configure_file(${SRC_IN} ${DST} @ONLY IMMEDIATE)
|
||||
elseif(EXISTS ${DST_IN})
|
||||
message("using generated ${DST} from ${DST_IN}")
|
||||
configure_file(${DST_IN} ${DST} @ONLY IMMEDIATE)
|
||||
elseif(EXISTS ${SRC})
|
||||
set(DST ${SRC})
|
||||
message("using ${DST}")
|
||||
elseif(EXISTS ${BIN})
|
||||
set(DST ${BIN})
|
||||
message("using ${DST}")
|
||||
elseif(EXISTS ${DST})
|
||||
message("using ${DST}")
|
||||
else()
|
||||
message(WARNING "Missing manpage section, considered:")
|
||||
message(WARNING " ${SRC_IN}")
|
||||
message(WARNING " ${DST_IN}")
|
||||
message(WARNING " ${SRC}")
|
||||
message(WARNING " ${BIN}")
|
||||
message(WARNING " ${DST}")
|
||||
message(FATAL_ERROR "Can not continue, terminating")
|
||||
endif()
|
||||
|
||||
file(READ ${DST} CONTENTS)
|
||||
file(APPEND ${CURRENT_BINARY_DIR}/${manpage} "${CONTENTS}")
|
||||
endforeach()
|
||||
128
third_party/FreeRDP/cmake/GetGitRevisionDescription.cmake
vendored
Normal file
128
third_party/FreeRDP/cmake/GetGitRevisionDescription.cmake
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
# - Returns a version string from Git
|
||||
#
|
||||
# These functions force a re-configure on each git commit so that you can
|
||||
# trust the values of the variables in your build system.
|
||||
#
|
||||
# get_git_head_revision(<refspecvar> <hashvar> [<additional arguments to git describe> ...])
|
||||
#
|
||||
# Returns the refspec and sha hash of the current head revision
|
||||
#
|
||||
# git_describe(<var> [<additional arguments to git describe> ...])
|
||||
#
|
||||
# Returns the results of git describe on the source tree, and adjusting
|
||||
# the output so that it tests false if an error occurs.
|
||||
#
|
||||
# git_get_exact_tag(<var> [<additional arguments to git describe> ...])
|
||||
#
|
||||
# Returns the results of git describe --exact-match on the source tree,
|
||||
# and adjusting the output so that it tests false if there was no exact
|
||||
# matching tag.
|
||||
#
|
||||
# Requires CMake 2.6 or newer (uses the 'function' command)
|
||||
#
|
||||
# Original Author:
|
||||
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
|
||||
# http://academic.cleardefinition.com
|
||||
# Iowa State University HCI Graduate Program/VRAC
|
||||
#
|
||||
# Copyright Iowa State University 2009-2010.
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
if(__get_git_revision_description)
|
||||
return()
|
||||
endif()
|
||||
set(__get_git_revision_description YES)
|
||||
|
||||
# We must run the following at "include" time, not at function call time,
|
||||
# to find the path to this module rather than the path to a calling list file
|
||||
get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)
|
||||
|
||||
function(get_git_head_revision _refspecvar _hashvar)
|
||||
|
||||
set(GIT_PARENT_DIR "${PROJECT_SOURCE_DIR}")
|
||||
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
|
||||
while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories
|
||||
set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}")
|
||||
get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH)
|
||||
if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT)
|
||||
# We have reached the root directory, we are not in git
|
||||
set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
|
||||
set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
|
||||
endwhile()
|
||||
set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
|
||||
if(NOT EXISTS "${GIT_DATA}")
|
||||
file(MAKE_DIRECTORY "${GIT_DATA}")
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS "${GIT_DIR}/HEAD")
|
||||
return()
|
||||
endif()
|
||||
set(HEAD_FILE "${GIT_DATA}/HEAD")
|
||||
configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY)
|
||||
|
||||
configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in" "${GIT_DATA}/grabRef.cmake" @ONLY)
|
||||
include("${GIT_DATA}/grabRef.cmake")
|
||||
|
||||
set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE)
|
||||
set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(git_rev_parse _var)
|
||||
if(NOT GIT_FOUND)
|
||||
find_package(Git QUIET)
|
||||
endif()
|
||||
if(NOT GIT_FOUND)
|
||||
set(${_var} "n/a" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
get_git_head_revision(refspec hash)
|
||||
if(NOT hash)
|
||||
set(${_var} "n/a" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND "${GIT_EXECUTABLE}" rev-parse ${ARGN} ${hash} WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" RESULT_VARIABLE res
|
||||
OUTPUT_VARIABLE out ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
if(NOT res EQUAL 0)
|
||||
set(out "n/a")
|
||||
endif()
|
||||
|
||||
set(${_var} "${out}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(git_describe _var)
|
||||
if(NOT GIT_FOUND)
|
||||
find_package(Git QUIET)
|
||||
endif()
|
||||
if(NOT GIT_FOUND)
|
||||
set(${_var} "n/a" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
get_git_head_revision(refspec hash)
|
||||
if(NOT hash)
|
||||
set(${_var} "n/a" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND "${GIT_EXECUTABLE}" describe ${hash} ${ARGN} WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" RESULT_VARIABLE res
|
||||
OUTPUT_VARIABLE out ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
if(NOT res EQUAL 0)
|
||||
set(out "n/a")
|
||||
endif()
|
||||
|
||||
set(${_var} "${out}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(git_get_exact_tag _var)
|
||||
git_describe(out --exact-match ${ARGN})
|
||||
set(${_var} "${out}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
38
third_party/FreeRDP/cmake/GetGitRevisionDescription.cmake.in
vendored
Normal file
38
third_party/FreeRDP/cmake/GetGitRevisionDescription.cmake.in
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
# Internal file for GetGitRevisionDescription.cmake
|
||||
#
|
||||
# Requires CMake 2.6 or newer (uses the 'function' command)
|
||||
#
|
||||
# Original Author:
|
||||
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
|
||||
# http://academic.cleardefinition.com
|
||||
# Iowa State University HCI Graduate Program/VRAC
|
||||
#
|
||||
# Copyright Iowa State University 2009-2010.
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
set(HEAD_HASH)
|
||||
|
||||
file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024)
|
||||
|
||||
string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
|
||||
if(HEAD_CONTENTS MATCHES "ref")
|
||||
# named branch
|
||||
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
|
||||
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
|
||||
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
|
||||
elseif(EXISTS "@GIT_DIR@/logs/${HEAD_REF}")
|
||||
configure_file("@GIT_DIR@/logs/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
|
||||
set(HEAD_HASH "${HEAD_REF}")
|
||||
endif()
|
||||
else()
|
||||
# detached HEAD
|
||||
configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
|
||||
endif()
|
||||
|
||||
if(NOT HEAD_HASH)
|
||||
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
|
||||
string(STRIP "${HEAD_HASH}" HEAD_HASH)
|
||||
endif()
|
||||
48
third_party/FreeRDP/cmake/GetProjectVersion.cmake
vendored
Normal file
48
third_party/FreeRDP/cmake/GetProjectVersion.cmake
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
option(USE_VERSION_FROM_GIT_TAG "Extract FreeRDP version from git tag." ON)
|
||||
option(USE_GIT_FOR_REVISION "Extract git tag/commit" OFF)
|
||||
|
||||
function(get_project_version VERSION_MAJOR VERSION_MINOR VERSION_REVISION VERSION_SUFFIX GIT_REVISION)
|
||||
|
||||
# Default version, hard codec per release
|
||||
set(RAW_VERSION_STRING "3.23.1-dev0")
|
||||
|
||||
set(VERSION_REGEX "^(.*)([0-9]+)\\.([0-9]+)\\.([0-9]+)-?(.*)")
|
||||
|
||||
# Prefer version from .source_tag file
|
||||
if(EXISTS "${PROJECT_SOURCE_DIR}/.source_tag")
|
||||
file(READ ${PROJECT_SOURCE_DIR}/.source_tag RAW_VERSION_STRING)
|
||||
# otherwise try to extract the version from a git tag
|
||||
elseif(USE_VERSION_FROM_GIT_TAG)
|
||||
git_get_exact_tag(_GIT_TAG --tags --always)
|
||||
if(NOT ${_GIT_TAG} STREQUAL "n/a")
|
||||
string(REGEX MATCH ${VERSION_REGEX} FOUND_TAG "${_GIT_TAG}")
|
||||
if(FOUND_TAG)
|
||||
set(RAW_VERSION_STRING ${_GIT_TAG})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Default git revision
|
||||
set(FKT_GIT_REVISION "n/a")
|
||||
|
||||
# Prefer git revision from .source_version file
|
||||
if(EXISTS "${PROJECT_SOURCE_DIR}/.source_version")
|
||||
file(READ ${PROJECT_SOURCE_DIR}/.source_version FKT_GIT_REVISION)
|
||||
string(STRIP ${FKT_GIT_REVISION} FKT_GIT_REVISION)
|
||||
# otherwise try to call git and extract tag/commit
|
||||
elseif(USE_VERSION_FROM_GIT_TAG OR USE_GIT_FOR_REVISION)
|
||||
git_rev_parse(FKT_GIT_REVISION --short)
|
||||
endif()
|
||||
|
||||
string(STRIP ${RAW_VERSION_STRING} RAW_VERSION_STRING)
|
||||
string(REGEX REPLACE "${VERSION_REGEX}" "\\2" FKT_VERSION_MAJOR "${RAW_VERSION_STRING}")
|
||||
string(REGEX REPLACE "${VERSION_REGEX}" "\\3" FKT_VERSION_MINOR "${RAW_VERSION_STRING}")
|
||||
string(REGEX REPLACE "${VERSION_REGEX}" "\\4" FKT_VERSION_REVISION "${RAW_VERSION_STRING}")
|
||||
string(REGEX REPLACE "${VERSION_REGEX}" "\\5" FKT_VERSION_SUFFIX "${RAW_VERSION_STRING}")
|
||||
|
||||
set(${VERSION_MAJOR} ${FKT_VERSION_MAJOR} PARENT_SCOPE)
|
||||
set(${VERSION_MINOR} ${FKT_VERSION_MINOR} PARENT_SCOPE)
|
||||
set(${VERSION_REVISION} ${FKT_VERSION_REVISION} PARENT_SCOPE)
|
||||
set(${VERSION_SUFFIX} ${FKT_VERSION_SUFFIX} PARENT_SCOPE)
|
||||
set(${GIT_REVISION} ${FKT_GIT_REVISION} PARENT_SCOPE)
|
||||
endfunction()
|
||||
14
third_party/FreeRDP/cmake/GetSysconfDir.cmake
vendored
Normal file
14
third_party/FreeRDP/cmake/GetSysconfDir.cmake
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
option(FREERDP_USE_VENDOR_PRODUCT_CONFIG_DIR "Use <vendor>/<product> path for resources" OFF)
|
||||
|
||||
function(get_sysconf_dir name result)
|
||||
set(CONF_FILE ${PRODUCT})
|
||||
if(WITH_RESOURCE_VERSIONING)
|
||||
string(APPEND CONF_FILE "${FREERDP_VERSION_MAJOR}")
|
||||
endif()
|
||||
if(FREERDP_USE_VENDOR_PRODUCT_CONFIG_DIR)
|
||||
string(PREPEND CONF_FILE "${VENDOR}/")
|
||||
endif()
|
||||
string(PREPEND CONF_FILE "${CMAKE_INSTALL_FULL_SYSCONFDIR}/")
|
||||
string(APPEND CONF_FILE "${name}")
|
||||
set(${result} ${CONF_FILE} PARENT_SCOPE)
|
||||
endfunction()
|
||||
28
third_party/FreeRDP/cmake/InstallFreeRDPDesktop.cmake
vendored
Normal file
28
third_party/FreeRDP/cmake/InstallFreeRDPDesktop.cmake
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
include(GNUInstallDirs)
|
||||
|
||||
option(WITH_INSTALL_CLIENT_DESKTOP_FILES "Install .desktop files for clients" OFF)
|
||||
|
||||
set(DESKTOP_RESOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../resources" CACHE INTERNAL "")
|
||||
|
||||
function(install_freerdp_desktop name)
|
||||
if(WITH_INSTALL_CLIENT_DESKTOP_FILES)
|
||||
if(${ARGC} GREATER 1)
|
||||
set(FREERDP_STARTUP_CLASS ${ARGV1})
|
||||
else()
|
||||
set(FREERDP_STARTUP_CLASS ${name})
|
||||
endif()
|
||||
|
||||
get_target_property(FREERDP_APP_NAME ${name} OUTPUT_NAME)
|
||||
set(FREERDP_BIN_NAME "${CMAKE_INSTALL_FULL_BINDIR}/${FREERDP_APP_NAME}")
|
||||
set(FREERDP_DESKTOP_NAME "${CMAKE_CURRENT_BINARY_DIR}/${FREERDP_BIN_NAME}.desktop")
|
||||
set(FREERDP_DESKTOP_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/${FREERDP_BIN_NAME}-file.desktop")
|
||||
configure_file(${DESKTOP_RESOURCE_DIR}/freerdp.desktop.template ${FREERDP_DESKTOP_NAME} @ONLY)
|
||||
configure_file(${DESKTOP_RESOURCE_DIR}/freerdp-file.desktop.template ${FREERDP_DESKTOP_FILE_NAME} @ONLY)
|
||||
install(FILES ${FREERDP_DESKTOP_NAME} ${FREERDP_DESKTOP_FILE_NAME}
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications
|
||||
)
|
||||
install(FILES ${DESKTOP_RESOURCE_DIR}/FreeRDP_Icon.svg
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps RENAME FreeRDP.svg
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
72
third_party/FreeRDP/cmake/InstallFreeRDPMan.cmake
vendored
Normal file
72
third_party/FreeRDP/cmake/InstallFreeRDPMan.cmake
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
include(today)
|
||||
include(GNUInstallDirs)
|
||||
include(CleaningConfigureFile)
|
||||
|
||||
get_filename_component(INSTALL_FREERDP_MAN_SCRIPT_DIR "${CMAKE_CURRENT_LIST_DIR}" ABSOLUTE)
|
||||
|
||||
function(install_freerdp_man manpage section)
|
||||
if(WITH_MANPAGES)
|
||||
install(FILES ${manpage} DESTINATION ${CMAKE_INSTALL_MANDIR}/man${section})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(generate_and_install_freerdp_man_from_template name_base section api)
|
||||
if(WITH_MANPAGES)
|
||||
if(WITH_BINARY_VERSIONING)
|
||||
set(manpage "${CMAKE_CURRENT_BINARY_DIR}/${name_base}${api}.${section}")
|
||||
else()
|
||||
set(manpage "${CMAKE_CURRENT_BINARY_DIR}/${name_base}.${section}")
|
||||
endif()
|
||||
set(MANPAGE_NAME ${name_base})
|
||||
cleaning_configure_file(${name_base}.${section}.in ${manpage})
|
||||
install_freerdp_man(${manpage} ${section})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Generate an install target for a manpage.
|
||||
#
|
||||
# This is not as simple as it looks like:
|
||||
#
|
||||
# 1. extract the raw file names (files that require configure_file end with .in, ready to use files
|
||||
# with .1 or some other manpage related number)
|
||||
# 2. do the same for every dependency
|
||||
# 3. create a command to run during build. Add a few defined symbols by default
|
||||
# 4. add variable names passed to the function to the command
|
||||
# 5. run CMake -P as custom_target during build.
|
||||
# * run configure_file for all .in files
|
||||
# * concatenate all manpage sections to the target manpage
|
||||
# 6. create the actual install target
|
||||
function(generate_and_install_freerdp_man_from_xml target section dependencies variable_names)
|
||||
if(WITH_MANPAGES)
|
||||
get_target_property(name_base "${target}" OUTPUT_NAME)
|
||||
set(template "${target}.${section}")
|
||||
set(MANPAGE_NAME "${name_base}")
|
||||
set(manpage "${name_base}.${section}")
|
||||
|
||||
# We need the variable ${MAN_TODAY} to contain the current date in ISO
|
||||
# format to replace it in the cleaning_configure_file step.
|
||||
include(today)
|
||||
|
||||
today(MAN_TODAY)
|
||||
|
||||
set(GENERATE_COMMAND
|
||||
-Dtemplate=\"${template}\" -DMANPAGE_NAME=\"${MANPAGE_NAME}\" -Dmanpage=\"${manpage}\"
|
||||
-DMAN_TODAY=\"${MAN_TODAY}\" -DCURRENT_SOURCE_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}\"
|
||||
-DCURRENT_BINARY_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\" -Dtarget="${target}" -Dsection="${section}"
|
||||
-Ddependencies="${dependencies}"
|
||||
)
|
||||
|
||||
foreach(var IN ITEMS ${variable_names})
|
||||
list(APPEND GENERATE_COMMAND -D${var}=${${var}})
|
||||
endforeach()
|
||||
|
||||
list(APPEND GENERATE_COMMAND -P \"${INSTALL_FREERDP_MAN_SCRIPT_DIR}/GenerateManpages.cmake\")
|
||||
|
||||
add_custom_target(
|
||||
${manpage}.target ALL COMMAND ${CMAKE_COMMAND} ${GENERATE_COMMAND} DEPENDS generate_argument_manpage.target
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
install_freerdp_man(${CMAKE_CURRENT_BINARY_DIR}/${manpage} ${section})
|
||||
endif()
|
||||
endfunction()
|
||||
175
third_party/FreeRDP/cmake/JsonDetect.cmake
vendored
Normal file
175
third_party/FreeRDP/cmake/JsonDetect.cmake
vendored
Normal file
@@ -0,0 +1,175 @@
|
||||
function(detect_package name)
|
||||
set(options REQUIRED)
|
||||
set(oneValueArgs HEADER LIBRARY PKGCONFIG CMAKE VERSION VERSION_STR)
|
||||
cmake_parse_arguments(PARSE_ARGV 0 arg "${options}" "${oneValueArgs}" "${multiValueArgs}")
|
||||
|
||||
find_package(${name} ${arg_VERSION})
|
||||
if(NOT ${name}_FOUND)
|
||||
# Fallback detection:
|
||||
# some distributions only ship pkg-config and skip CMake config files.
|
||||
find_package(PkgConfig)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
if(arg_PKGCONFIG)
|
||||
set(module ${arg_PKGCONFIG})
|
||||
else()
|
||||
set(module ${name})
|
||||
endif()
|
||||
if(arg_VERSION)
|
||||
string(APPEND module ">=${arg_VERSION}")
|
||||
endif()
|
||||
pkg_check_modules(${name} ${module})
|
||||
endif()
|
||||
|
||||
# No CMake nor pkg-config files available, try manual detection
|
||||
if(NOT ${name}_FOUND)
|
||||
find_library(
|
||||
${name}_LIBRARY NAMES ${arg_LIBRARY} ${arg_PKGCONFIG} ${arg_CMAKE} ${name} ${arg_CMAKE}
|
||||
PATH_SUFFIXES ${name} ${arg_PKGCONFIG} ${arg_CMAKE}
|
||||
)
|
||||
|
||||
find_path(${name}_HEADER NAMES ${arg_HEADER} ${name}.h ${arg_PKGCONFIG}.h ${arg_CMAKE}.h
|
||||
PATH_SUFFIXES ${name} ${arg_PKGCONFIG} ${arg_CMAKE}
|
||||
)
|
||||
|
||||
if(NOT ${name}_LIBRARY STREQUAL "${name}_LIBRARY-NOTFOUND" AND NOT ${name}_HEADER STREQUAL
|
||||
"${name}_HEADER-NOTFOUND"
|
||||
)
|
||||
set(${name}_LINK_LIBRARIES "${${name}_LIBRARY}")
|
||||
set(${name}_INCLUDE_DIRS "${${name}_HEADER}")
|
||||
get_filename_component(${name}_LIB_FILE "${${name}_LIBRARY}" NAME_WE)
|
||||
set(regex "^${CMAKE_SHARED_LIBRARY_PREFIX}")
|
||||
string(REGEX REPLACE "${regex}" "" ${name}_LIBRARIES "${${name}_LIB_FILE}")
|
||||
if(arg_VERSION)
|
||||
find_file(HEADER NAMES ${arg_HEADER} ${name}.h ${arg_PKGCONFIG}.h ${arg_CMAKE}.h
|
||||
PATH_SUFFIXES ${name} ${arg_PKGCONFIG} ${arg_CMAKE} PATHS ${name}_HEADER
|
||||
)
|
||||
file(STRINGS ${HEADER} file_data REGEX "[ \t ]${arg_VERSION_STR}[ \t ]")
|
||||
string(REGEX MATCH "([0-9]+\\.[0-9]+(\\.[0-9]+)?)" file_version "${file_data}")
|
||||
if(file_version)
|
||||
if(file_version GREATER_EQUAL "${arg_VERSION}")
|
||||
set(${name}_FOUND ON)
|
||||
else()
|
||||
if(arg_REQUIRED)
|
||||
message(FATAL_ERROR "${name} has version ${file_version}, but >= ${arg_VERSION} required")
|
||||
else()
|
||||
message(WARNING "${name} has version ${file_version}, but >= ${arg_VERSION} required")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
set(${name}_FOUND ON)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(${name}_FOUND)
|
||||
# Create imported target cjson
|
||||
add_library(${arg_CMAKE} SHARED IMPORTED)
|
||||
set_property(TARGET ${arg_CMAKE} APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
|
||||
set_target_properties(
|
||||
${arg_CMAKE}
|
||||
PROPERTIES IMPORTED_CONFIGURATIONS NOCONFIG IMPORTED_LINK_INTERFACE_LANGUAGES_NOCONFIG "C"
|
||||
IMPORTED_LOCATION_NOCONFIG "${${name}_LINK_LIBRARIES}" IMPORTED_SONAME_NOCONFIG
|
||||
"${${name}_LIBRARIES}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${${name}_INCLUDE_DIRS}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT ${name}_FOUND AND arg_REQUIRED)
|
||||
message(FATAL_ERROR "${name} was REQUIRED but not found")
|
||||
endif()
|
||||
|
||||
if(${${name}_FOUND})
|
||||
set(${name}_FOUND ${${name}_FOUND} CACHE INTERNAL "internal")
|
||||
else()
|
||||
unset(${name}_FOUND CACHE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
include(CMakeDependentOption)
|
||||
|
||||
option(WITH_JSON_DISABLED "Build without any JSON support" OFF)
|
||||
cmake_dependent_option(
|
||||
WITH_CJSON_REQUIRED "Build with cJSON (fail if not found)" OFF
|
||||
"NOT WITH_JSON_DISABLED;NOT WITH_JSONC_REQUIRED;NOT WITH_JANSSON_REQUIRED" OFF
|
||||
)
|
||||
cmake_dependent_option(
|
||||
WITH_JSONC_REQUIRED "Build with JSON-C (fail if not found)" OFF
|
||||
"NOT WITH_JSON_DISABLED;NOT WITH_CJSON_REQUIRED;NOT WITH_JANSSON_REQUIRED" OFF
|
||||
)
|
||||
cmake_dependent_option(
|
||||
WITH_JANSSON_REQUIRED "Build with JANSSON (fail if not found)" OFF
|
||||
"NOT WITH_JSON_DISABLED;NOT WITH_CJSON_REQUIRED;NOT WITH_JSONC_REQUIRED" OFF
|
||||
)
|
||||
|
||||
# ensure no package is enabled before the detection starts
|
||||
unset(json-c_FOUND CACHE)
|
||||
unset(cJSON_FOUND CACHE)
|
||||
unset(jansson_FOUND CACHE)
|
||||
if(NOT WITH_JSON_DISABLED)
|
||||
if(WITH_JANSSON_REQUIRED)
|
||||
detect_package(
|
||||
jansson
|
||||
CMAKE
|
||||
jansson::jansson
|
||||
HEADER
|
||||
jansson.h
|
||||
VERSION
|
||||
2.13
|
||||
VERSION_STR
|
||||
JANSSON_VERSION
|
||||
REQUIRED
|
||||
)
|
||||
elseif(WITH_JSONC_REQUIRED)
|
||||
detect_package(json-c CMAKE json-c::json-c HEADER json-c/json.h REQUIRED)
|
||||
elseif(WITH_CJSON_REQUIRED)
|
||||
detect_package(
|
||||
cJSON
|
||||
PKGCONFIG
|
||||
libcjson
|
||||
CMAKE
|
||||
cjson
|
||||
HEADER
|
||||
cjson/cJSON.h
|
||||
REQUIRED
|
||||
)
|
||||
else()
|
||||
# nothing required, so do a non fatal check for all
|
||||
detect_package(
|
||||
jansson
|
||||
CMAKE
|
||||
jansson::jansson
|
||||
HEADER
|
||||
jansson.h
|
||||
VERSION
|
||||
2.13
|
||||
VERSION_STR
|
||||
JANSSON_VERSION
|
||||
)
|
||||
detect_package(json-c CMAKE json-c::json-c HEADER json-c/json.h)
|
||||
detect_package(
|
||||
cJSON
|
||||
PKGCONFIG
|
||||
libcjson
|
||||
CMAKE
|
||||
cjson
|
||||
HEADER
|
||||
cjson/cJSON.h
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT json-c_FOUND AND NOT cJSON_FOUND AND NOT jansson_FOUND)
|
||||
if(WITH_CJSON_REQUIRED OR WITH_JSONC_REQUIRED OR WITH_JANSSON_REQUIRED)
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"cJSON (${WITH_CJSON_REQUIRED}) or json-c (${WITH_JSONC_REQUIRED}) or jansson (${WITH_JANSSON_REQUIRED}) required but not found"
|
||||
)
|
||||
endif()
|
||||
set(WITH_WINPR_JSON OFF CACHE INTERNAL "internal")
|
||||
message("compiling without JSON support. Install cJSON or json-c to enable")
|
||||
endif()
|
||||
else()
|
||||
set(WITH_WINPR_JSON OFF CACHE INTERNAL "internal")
|
||||
message("forced compile without JSON support. Set -DWITH_JSON_DISABLED=OFF to enable compile time detection")
|
||||
endif()
|
||||
115
third_party/FreeRDP/cmake/LibFindMacros.cmake
vendored
Normal file
115
third_party/FreeRDP/cmake/LibFindMacros.cmake
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
# Works the same as find_package, but forwards the "REQUIRED" and "QUIET" arguments
|
||||
# used for the current package. For this to work, the first parameter must be the
|
||||
# prefix of the current package, then the prefix of the new package etc, which are
|
||||
# passed to find_package.
|
||||
macro(libfind_package PREFIX)
|
||||
set(LIBFIND_PACKAGE_ARGS $ {ARGN})
|
||||
if($ {PREFIX} _FIND_QUIETLY)
|
||||
set(LIBFIND_PACKAGE_ARGS $ {LIBFIND_PACKAGE_ARGS} QUIET)
|
||||
endif($ {PREFIX} _FIND_QUIETLY)
|
||||
if($ {PREFIX} _FIND_REQUIRED)
|
||||
set(LIBFIND_PACKAGE_ARGS $ {LIBFIND_PACKAGE_ARGS} REQUIRED)
|
||||
endif($ {PREFIX} _FIND_REQUIRED)
|
||||
find_package($ {LIBFIND_PACKAGE_ARGS})
|
||||
endmacro(libfind_package)
|
||||
|
||||
# CMake developers made the UsePkgConfig system deprecated in the same release (2.6)
|
||||
# where they added pkg_check_modules. Consequently I need to support both in my scripts
|
||||
# to avoid those deprecated warnings. Here's a helper that does just that.
|
||||
# Works identically to pkg_check_modules, except that no checks are needed prior to use.
|
||||
macro(libfind_pkg_check_modules PREFIX PKGNAME)
|
||||
if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
|
||||
include(UsePkgConfig)
|
||||
pkgconfig(${PKGNAME} ${PREFIX}_INCLUDE_DIRS ${PREFIX}_LIBRARY_DIRS ${PREFIX}_LDFLAGS ${PREFIX}_CFLAGS)
|
||||
else(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
|
||||
find_package(PkgConfig)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(${PREFIX} ${PKGNAME})
|
||||
endif(PKG_CONFIG_FOUND)
|
||||
endif(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
|
||||
endmacro(libfind_pkg_check_modules)
|
||||
|
||||
# Do the final processing once the paths have been detected.
|
||||
# If include dirs are needed, ${PREFIX}_PROCESS_INCLUDES should be set to contain
|
||||
# all the variables, each of which contain one include directory.
|
||||
# Ditto for ${PREFIX}_PROCESS_LIBS and library files.
|
||||
# Will set ${PREFIX}_FOUND, ${PREFIX}_INCLUDE_DIRS and ${PREFIX}_LIBRARIES.
|
||||
# Also handles errors in case library detection was required, etc.
|
||||
macro(libfind_process PREFIX)
|
||||
# Skip processing if already processed during this run
|
||||
if(NOT ${PREFIX}_FOUND)
|
||||
# Start with the assumption that the library was found
|
||||
set(${PREFIX}_FOUND TRUE)
|
||||
|
||||
# Process all includes and set _FOUND to false if any are missing
|
||||
foreach(i ${${PREFIX}_PROCESS_INCLUDES})
|
||||
if(${i})
|
||||
set(${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIRS} ${${i}})
|
||||
mark_as_advanced(${i})
|
||||
else(${i})
|
||||
set(${PREFIX}_FOUND FALSE)
|
||||
endif(${i})
|
||||
endforeach(i)
|
||||
|
||||
# Process all libraries and set _FOUND to false if any are missing
|
||||
foreach(i ${${PREFIX}_PROCESS_LIBS})
|
||||
if(${i})
|
||||
set(${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARIES} ${${i}})
|
||||
mark_as_advanced(${i})
|
||||
else(${i})
|
||||
set(${PREFIX}_FOUND FALSE)
|
||||
endif(${i})
|
||||
endforeach(i)
|
||||
|
||||
# Print message and/or exit on fatal error
|
||||
if(${PREFIX}_FOUND)
|
||||
if(NOT ${PREFIX}_FIND_QUIETLY)
|
||||
message(STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}")
|
||||
endif(NOT ${PREFIX}_FIND_QUIETLY)
|
||||
else(${PREFIX}_FOUND)
|
||||
if(${PREFIX}_FIND_REQUIRED)
|
||||
foreach(i ${${PREFIX}_PROCESS_INCLUDES} ${${PREFIX}_PROCESS_LIBS})
|
||||
message("${i}=${${i}}")
|
||||
endforeach(i)
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Required library ${PREFIX} NOT FOUND.\nInstall the library (dev version) and try again. If the library is already installed, use ccmake to set the missing variables manually."
|
||||
)
|
||||
endif(${PREFIX}_FIND_REQUIRED)
|
||||
endif(${PREFIX}_FOUND)
|
||||
endif(NOT ${PREFIX}_FOUND)
|
||||
endmacro(libfind_process)
|
||||
|
||||
macro(libfind_library PREFIX basename)
|
||||
set(TMP "")
|
||||
if(MSVC80)
|
||||
set(TMP -vc80)
|
||||
endif(MSVC80)
|
||||
if(MSVC90)
|
||||
set(TMP -vc90)
|
||||
endif(MSVC90)
|
||||
set(${PREFIX}_LIBNAMES ${basename}${TMP})
|
||||
if(${ARGC} GREATER 2)
|
||||
set(${PREFIX}_LIBNAMES ${basename}${TMP}-${ARGV2})
|
||||
string(REGEX REPLACE "\\." "_" TMP ${${PREFIX}_LIBNAMES})
|
||||
set(${PREFIX}_LIBNAMES ${${PREFIX}_LIBNAMES} ${TMP})
|
||||
endif(${ARGC} GREATER 2)
|
||||
find_library(${PREFIX}_LIBRARY NAMES ${${PREFIX}_LIBNAMES} PATHS ${${PREFIX}_PKGCONF_LIBRARY_DIRS})
|
||||
endmacro(libfind_library)
|
||||
|
||||
set(THREE_PART_VERSION_REGEX "[0-9]+\\.[0-9]+\\.[0-9]+")
|
||||
# Breaks up a string in the form n1.n2.n3 into three parts and stores
|
||||
# them in major, minor, and patch. version should be a value, not a
|
||||
# variable, while major, minor and patch should be variables.
|
||||
macro(THREE_PART_VERSION_TO_VARS version major minor patch)
|
||||
if(${version} MATCHES ${THREE_PART_VERSION_REGEX})
|
||||
string(REPLACE "." " " version_list ${version})
|
||||
separate_arguments(version_list)
|
||||
list(GET version_list 0 ${major})
|
||||
list(GET version_list 1 ${minor})
|
||||
list(GET version_list 2 ${patch})
|
||||
else(${version} MATCHES ${THREE_PART_VERSION_REGEX})
|
||||
message("MACRO(THREE_PART_VERSION_TO_VARS ${version} ${major} ${minor} ${patch}")
|
||||
message(FATAL_ERROR "Problem parsing version string, I can't parse it properly.")
|
||||
endif(${version} MATCHES ${THREE_PART_VERSION_REGEX})
|
||||
endmacro(THREE_PART_VERSION_TO_VARS)
|
||||
35
third_party/FreeRDP/cmake/ListTargetProperties.cmake
vendored
Normal file
35
third_party/FreeRDP/cmake/ListTargetProperties.cmake
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
# Get all properties that cmake supports
|
||||
if(NOT CMAKE_PROPERTY_LIST)
|
||||
execute_process(COMMAND cmake --help-property-list OUTPUT_VARIABLE CMAKE_PROPERTY_LIST)
|
||||
|
||||
# Convert command output into a CMake list
|
||||
string(REGEX REPLACE ";" "\\\\;" CMAKE_PROPERTY_LIST "${CMAKE_PROPERTY_LIST}")
|
||||
string(REGEX REPLACE "\n" ";" CMAKE_PROPERTY_LIST "${CMAKE_PROPERTY_LIST}")
|
||||
list(REMOVE_DUPLICATES CMAKE_PROPERTY_LIST)
|
||||
endif()
|
||||
|
||||
function(print_properties)
|
||||
message("CMAKE_PROPERTY_LIST = ${CMAKE_PROPERTY_LIST}")
|
||||
endfunction()
|
||||
|
||||
function(list_target_properties target)
|
||||
if(NOT TARGET ${target})
|
||||
message(STATUS "There is no target named '${target}'")
|
||||
return()
|
||||
endif()
|
||||
|
||||
foreach(property ${CMAKE_PROPERTY_LIST})
|
||||
string(REPLACE "<CONFIG>" "${CMAKE_BUILD_TYPE}" property ${property})
|
||||
|
||||
# Fix https://stackoverflow.com/questions/32197663/how-can-i-remove-the-the-location-property-may-not-be-read-from-target-error-i
|
||||
if(property STREQUAL "LOCATION" OR property MATCHES "^LOCATION_" OR property MATCHES "_LOCATION$")
|
||||
continue()
|
||||
endif()
|
||||
|
||||
get_property(was_set TARGET ${target} PROPERTY ${property} SET)
|
||||
if(was_set)
|
||||
get_target_property(value ${target} ${property})
|
||||
message("${target} ${property} = ${value}")
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
47
third_party/FreeRDP/cmake/MSVCRuntime.cmake
vendored
Normal file
47
third_party/FreeRDP/cmake/MSVCRuntime.cmake
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
if(MSVC)
|
||||
if(CMAKE_VERSION VERSION_LESS 3.15.0)
|
||||
message(FATAL_ERROR "windows builds require CMake >= 3.15")
|
||||
endif()
|
||||
if(NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
|
||||
if(MSVC_RUNTIME STREQUAL "dynamic")
|
||||
set(MSVC_DEFAULT_RUNTIME "MultiThreadedDLL")
|
||||
elseif(MSVC_RUNTIME STREQUAL "static")
|
||||
set(MSVC_DEFAULT_RUNTIME "MultiThreaded")
|
||||
else()
|
||||
message(WARNING "invalid MSVC_RUNTIME (deprecated) value '${MSVC_RUNTIME}', ignoring")
|
||||
endif()
|
||||
|
||||
if(MSVC_DEFAULT_RUNTIME)
|
||||
message(
|
||||
"Using CMAKE_MSVC_RUNTIME_LIBRARY=${MSVC_DEFAULT_RUNTIME} (derived from MSVC_RUNTIME (deprecated) value '${MSVC_RUNTIME}')"
|
||||
)
|
||||
else()
|
||||
set(MSVC_DEFAULT_RUNTIME "MultiThreaded")
|
||||
|
||||
string(APPEND MSVC_DEFAULT_RUNTIME "$<$<CONFIG:Debug>:Debug>")
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
string(APPEND MSVC_DEFAULT_RUNTIME "DLL")
|
||||
endif()
|
||||
message("Using CMAKE_MSVC_RUNTIME_LIBRARY=${MSVC_DEFAULT_RUNTIME}")
|
||||
endif()
|
||||
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY ${MSVC_DEFAULT_RUNTIME} CACHE STRING "MSVC runtime")
|
||||
endif()
|
||||
|
||||
message("build is using MSVC runtime ${CMAKE_MSVC_RUNTIME_LIBRARY}")
|
||||
|
||||
string(FIND ${CMAKE_MSVC_RUNTIME_LIBRARY} "DLL" IS_SHARED)
|
||||
if(IS_SHARED STREQUAL "-1")
|
||||
if(BUILD_SHARED_LIBS)
|
||||
message(FATAL_ERROR "Static CRT is only supported in a fully static build")
|
||||
endif()
|
||||
message(STATUS "Use the MSVC static runtime option carefully!")
|
||||
message(STATUS "OpenSSL uses /MD by default, and is very picky")
|
||||
message(STATUS "Random freeing errors are a common sign of runtime issues")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_SUPPRESS_REGENERATION)
|
||||
set(CMAKE_SUPPRESS_REGENERATION ON)
|
||||
endif()
|
||||
endif()
|
||||
151
third_party/FreeRDP/cmake/MergeStaticLibs.cmake
vendored
Normal file
151
third_party/FreeRDP/cmake/MergeStaticLibs.cmake
vendored
Normal file
@@ -0,0 +1,151 @@
|
||||
# Copyright (C) 2012 Modelon AB
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the BSD style license.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# FMILIB_License.txt file for more details.
|
||||
|
||||
# You should have received a copy of the FMILIB_License.txt file
|
||||
# along with this program. If not, contact Modelon AB <http://www.modelon.com>.
|
||||
|
||||
# Merge_static_libs(output_library lib1 lib2 ... libn) merges a number of static
|
||||
# libs into a single static library
|
||||
function(merge_static_libs output_library)
|
||||
set(output_target "${output_library}")
|
||||
string(REGEX REPLACE "-" "_" output_library ${output_library})
|
||||
set(libs ${ARGV})
|
||||
list(REMOVE_AT libs 0)
|
||||
|
||||
# Create a dummy file that the target will depend on
|
||||
set(dummyfile ${CMAKE_CURRENT_BINARY_DIR}/${output_library}_dummy.c)
|
||||
file(WRITE ${dummyfile} "const char * dummy = \"${dummyfile}\";")
|
||||
|
||||
add_library(${output_target} STATIC ${dummyfile})
|
||||
|
||||
if("${CMAKE_CFG_INTDIR}" STREQUAL ".")
|
||||
set(multiconfig FALSE)
|
||||
else()
|
||||
set(multiconfig TRUE)
|
||||
endif()
|
||||
|
||||
# First get the file names of the libraries to be merged
|
||||
foreach(lib ${libs})
|
||||
get_target_property(libtype ${lib} TYPE)
|
||||
if(NOT libtype STREQUAL "STATIC_LIBRARY")
|
||||
message(FATAL_ERROR "Merge_static_libs can only process static libraries")
|
||||
endif()
|
||||
if(multiconfig)
|
||||
foreach(CONFIG_TYPE ${CMAKE_CONFIGURATION_TYPES})
|
||||
get_target_property("libfile_${CONFIG_TYPE}" ${lib} "LOCATION_${CONFIG_TYPE}")
|
||||
list(APPEND libfiles_${CONFIG_TYPE} ${libfile_${CONFIG_TYPE}})
|
||||
endforeach()
|
||||
else()
|
||||
get_target_property(libfile ${lib} LOCATION)
|
||||
list(APPEND libfiles "${libfile}")
|
||||
endif(multiconfig)
|
||||
endforeach()
|
||||
|
||||
# Just to be sure: cleanup from duplicates
|
||||
if(multiconfig)
|
||||
foreach(CONFIG_TYPE ${CMAKE_CONFIGURATION_TYPES})
|
||||
list(REMOVE_DUPLICATES libfiles_${CONFIG_TYPE})
|
||||
set(libfiles ${libfiles} ${libfiles_${CONFIG_TYPE}})
|
||||
endforeach()
|
||||
endif()
|
||||
list(REMOVE_DUPLICATES libfiles)
|
||||
|
||||
# Now the easy part for MSVC and for MAC
|
||||
if(MSVC)
|
||||
# lib.exe does the merging of libraries just need to convert the list into string
|
||||
foreach(CONFIG_TYPE ${CMAKE_CONFIGURATION_TYPES})
|
||||
set(flags "")
|
||||
foreach(lib ${libfiles_${CONFIG_TYPE}})
|
||||
set(flags "${flags} ${lib}")
|
||||
endforeach()
|
||||
string(TOUPPER "STATIC_LIBRARY_FLAGS_${CONFIG_TYPE}" PROPNAME)
|
||||
set_target_properties(${output_target} PROPERTIES ${PROPNAME} "${flags}")
|
||||
endforeach()
|
||||
|
||||
elseif(APPLE)
|
||||
# Use OSX's libtool to merge archives
|
||||
if(multiconfig)
|
||||
message(FATAL_ERROR "Multiple configurations are not supported")
|
||||
endif()
|
||||
get_target_property(outfile ${output_target} LOCATION)
|
||||
add_custom_command(
|
||||
TARGET ${output_target} POST_BUILD COMMAND rm ${outfile} COMMAND /usr/bin/libtool -static -o ${outfile}
|
||||
${libfiles}
|
||||
)
|
||||
else()
|
||||
# general UNIX - need to "ar -x" and then "ar -ru"
|
||||
if(multiconfig)
|
||||
message(FATAL_ERROR "Multiple configurations are not supported")
|
||||
endif()
|
||||
get_target_property(outfile ${output_target} LOCATION)
|
||||
message(STATUS "output file location is ${outfile}")
|
||||
foreach(lib ${libfiles})
|
||||
# objlistfile will contain the list of object files for the library
|
||||
set(objlistfile ${lib}.objlist)
|
||||
set(objdir ${lib}.objdir)
|
||||
set(objlistcmake ${objlistfile}.cmake)
|
||||
get_filename_component(libname ${lib} NAME_WE)
|
||||
|
||||
if(${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/cmake.check_cache IS_NEWER_THAN ${objlistcmake})
|
||||
|
||||
file(
|
||||
WRITE ${objlistcmake}
|
||||
"
|
||||
# delete previous object files
|
||||
message(STATUS \"Removing previous object files from ${lib}\")
|
||||
EXECUTE_PROCESS(COMMAND ls .
|
||||
WORKING_DIRECTORY ${objdir}
|
||||
COMMAND xargs -I {} rm {}
|
||||
WORKING_DIRECTORY ${objdir})
|
||||
# Extract object files from the library
|
||||
message(STATUS \"Extracting object files from ${lib}\")
|
||||
EXECUTE_PROCESS(COMMAND ${CMAKE_AR} -x ${lib}
|
||||
WORKING_DIRECTORY ${objdir})
|
||||
# Prefixing object files to avoid conflicts
|
||||
message(STATUS \"Prefixing object files to avoid conflicts\")
|
||||
EXECUTE_PROCESS(COMMAND ls .
|
||||
WORKING_DIRECTORY ${objdir}
|
||||
COMMAND xargs -I {} mv {} ${libname}_{}
|
||||
WORKING_DIRECTORY ${objdir})
|
||||
# save the list of object files
|
||||
EXECUTE_PROCESS(COMMAND ls .
|
||||
OUTPUT_FILE ${objlistfile}
|
||||
WORKING_DIRECTORY ${objdir})
|
||||
"
|
||||
)
|
||||
|
||||
file(MAKE_DIRECTORY ${objdir})
|
||||
|
||||
add_custom_command(OUTPUT ${objlistfile} COMMAND ${CMAKE_COMMAND} -P ${objlistcmake} DEPENDS ${lib})
|
||||
|
||||
endif()
|
||||
|
||||
list(APPEND extrafiles "${objlistfile}")
|
||||
# relative path is needed by ar under MSYS
|
||||
file(RELATIVE_PATH objlistfilerpath ${objdir} ${objlistfile})
|
||||
add_custom_command(
|
||||
TARGET ${output_target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E echo
|
||||
"Running: ${CMAKE_AR} ru ${outfile} @${objlistfilerpath}"
|
||||
COMMAND ${CMAKE_AR} ru "${outfile}" @"${objlistfilerpath}"
|
||||
#COMMAND ld -r -static -o "${outfile}" --whole-archive @"${objlistfilerpath}"
|
||||
WORKING_DIRECTORY ${objdir}
|
||||
)
|
||||
endforeach()
|
||||
add_custom_command(
|
||||
TARGET ${output_target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E echo "Running: ${CMAKE_RANLIB} ${outfile}"
|
||||
COMMAND ${CMAKE_RANLIB} ${outfile}
|
||||
)
|
||||
endif()
|
||||
file(WRITE ${dummyfile}.base "const char* ${output_library}_sublibs=\"${libs}\";")
|
||||
add_custom_command(
|
||||
OUTPUT ${dummyfile} COMMAND ${CMAKE_COMMAND} -E copy ${dummyfile}.base ${dummyfile} DEPENDS ${libs} ${extrafiles}
|
||||
)
|
||||
|
||||
endfunction()
|
||||
17
third_party/FreeRDP/cmake/PkgConfigHelpers.cmake
vendored
Normal file
17
third_party/FreeRDP/cmake/PkgConfigHelpers.cmake
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
set(FREERDP_CLIENT_PC_REQUIRES_PRIVATE "" CACHE INTERNAL "dependencies")
|
||||
|
||||
function(freerdp_client_pc_add_requires_private)
|
||||
foreach(_lib ${ARGN})
|
||||
list(APPEND FREERDP_CLIENT_PC_REQUIRES_PRIVATE ${_lib})
|
||||
endforeach()
|
||||
set(FREERDP_CLIENT_PC_REQUIRES_PRIVATE ${FREERDP_CLIENT_PC_REQUIRES_PRIVATE} CACHE INTERNAL "dependencies")
|
||||
endfunction()
|
||||
|
||||
set(FREERDP_CLIENT_PC_LIBRARY_PRIVATE "" CACHE INTERNAL "dependencies")
|
||||
|
||||
function(freerdp_client_pc_add_library_private)
|
||||
foreach(_lib ${ARGN})
|
||||
list(APPEND FREERDP_CLIENT_PC_LIBRARY_PRIVATE ${_lib})
|
||||
endforeach()
|
||||
set(FREERDP_CLIENT_PC_LIBRARY_PRIVATE ${FREERDP_CLIENT_PC_LIBRARY_PRIVATE} CACHE INTERNAL "dependencies")
|
||||
endfunction()
|
||||
110
third_party/FreeRDP/cmake/PlatformDefaults.cmake
vendored
Normal file
110
third_party/FreeRDP/cmake/PlatformDefaults.cmake
vendored
Normal file
@@ -0,0 +1,110 @@
|
||||
# This option allows deactivating FreeRDP supplied platform defaults to replace these with
|
||||
# user supplied values.
|
||||
#
|
||||
# Compilation will fail without a replacement defining the symbols, but that can be
|
||||
# done by supplying a TOOLCHAIN_FILE defining these.
|
||||
option(USE_PLATFORM_DEFAULT
|
||||
"Use this configuration file for platform defaults. Supply -DCMAKE_TOOLCHAIN_FILE=<yourfile>." ON
|
||||
)
|
||||
if(USE_PLATFORM_DEFAULT)
|
||||
# default defines or other required preferences per platform
|
||||
if((CMAKE_SYSTEM_NAME MATCHES "WindowsStore") AND (CMAKE_SYSTEM_VERSION MATCHES "10.0"))
|
||||
set(UWP 1 CACHE BOOL "platform default")
|
||||
add_compile_definitions("_UWP")
|
||||
set(CMAKE_WINDOWS_VERSION "WIN10" CACHE STRING "platform default")
|
||||
endif()
|
||||
|
||||
if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
|
||||
# Linux already does define _POSIX_C_SOURCE by default, nothing to do
|
||||
add_compile_definitions("_FILE_OFFSET_BITS=64")
|
||||
set(WINPR_TIMEZONE_FILE "/etc/timezone")
|
||||
endif()
|
||||
|
||||
if("${CMAKE_SYSTEM_NAME}" MATCHES "FreeBSD")
|
||||
set(BSD TRUE CACHE INTERNAL "platform default")
|
||||
set(FREEBSD TRUE CACHE INTERNAL "platform default")
|
||||
# we want POSIX 2008. FreeBSD 14 does only support 2001 fully, but the subset we require from 2008
|
||||
# is implemented, so ignore _POSIX_VERSION from unistd.h
|
||||
add_compile_definitions("_POSIX_C_SOURCE=200809L")
|
||||
# TODO: FreeBSD allows mixing POSIX and BSD API calls if we do not set
|
||||
# _POSIX_C_SOURCE but lack a macro to re-enable the BSD calls...
|
||||
add_compile_definitions("__BSD_VISIBLE")
|
||||
|
||||
# There are some symbols only visible for XOpen standard
|
||||
add_compile_definitions("_XOPEN_SOURCE=700")
|
||||
add_compile_definitions("_FILE_OFFSET_BITS=64")
|
||||
set(WINPR_TIMEZONE_FILE "/var/db/zoneinfo")
|
||||
endif()
|
||||
|
||||
if("${CMAKE_SYSTEM_NAME}" MATCHES "SunOS")
|
||||
# TODO: Does somebody still use this? please show yourself and
|
||||
# tell us if this still works.
|
||||
add_compile_definitions("_POSIX_PTHREAD_SEMANTICS")
|
||||
list(APPEND CMAKE_STANDARD_LIBRARIES rt)
|
||||
set(CMAKE_STANDARD_LIBRARIES ${CMAKE_STANDARD_LIBRARIES} CACHE STRING "platform default")
|
||||
set(WITH_SUN true CACHE BOOL "platform default")
|
||||
endif()
|
||||
|
||||
if("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
|
||||
# we want POSIX 2008. MacOS does only support 2001 fully, but the subset we require from 2008
|
||||
# is implemented, so ignore _POSIX_VERSION from unistd.h
|
||||
add_compile_definitions("_POSIX_C_SOURCE=200809L")
|
||||
|
||||
# as _POSIX_C_SOURCE sets a fully POSIX confirmant environment re-enable
|
||||
# MacOS API visibility by defining the following feature test macro
|
||||
add_compile_definitions("_DARWIN_C_SOURCE")
|
||||
endif()
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "kFreeBSD")
|
||||
set(BSD TRUE CACHE INTERNAL "platform default")
|
||||
set(KFREEBSD TRUE CACHE INTERNAL "platform default")
|
||||
add_compile_definitions(KFREEBSD)
|
||||
add_compile_definitions("_GNU_SOURCE")
|
||||
endif()
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
|
||||
set(BSD TRUE CACHE INTERNAL "platform default")
|
||||
set(OPENBSD TRUE CACHE INTERNAL "platform default")
|
||||
endif()
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "DragonFly")
|
||||
set(BSD TRUE CACHE INTERNAL "platform default")
|
||||
set(FREEBSD TRUE CACHE INTERNAL "platform default")
|
||||
|
||||
# we want POSIX 2008. FreeBSD 14 does only support 2001 fully, but the subset we require from 2008
|
||||
# is implemented, so ignore _POSIX_VERSION from unistd.h
|
||||
add_compile_definitions("_POSIX_C_SOURCE=200809L")
|
||||
# TODO: FreeBSD allows mixing POSIX and BSD API calls if we do not set
|
||||
# _POSIX_C_SOURCE but lack a macro to re-enable the BSD calls...
|
||||
add_compile_definitions("__BSD_VISIBLE")
|
||||
|
||||
# There are some symbols only visible for XOpen standard
|
||||
add_compile_definitions("_XOPEN_SOURCE=700")
|
||||
add_compile_definitions("_FILE_OFFSET_BITS=64")
|
||||
set(WINPR_TIMEZONE_FILE "/var/db/zoneinfo")
|
||||
endif()
|
||||
|
||||
if(BSD)
|
||||
if(IS_DIRECTORY /usr/local/include)
|
||||
include_directories(SYSTEM /usr/local/include)
|
||||
link_directories(/usr/local/lib)
|
||||
endif()
|
||||
if(OPENBSD)
|
||||
if(IS_DIRECTORY /usr/X11R6/include)
|
||||
include_directories(SYSTEM /usr/X11R6/include)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# define a fallback for systems that do not support a timezone file or we did not yet test.
|
||||
# since most of these are BSD try a sensible default
|
||||
if(NOT WINPR_TIMEZONE_FILE)
|
||||
set(WINPR_TIMEZONE_FILE "/var/db/zoneinfo")
|
||||
endif()
|
||||
add_compile_definitions("WINPR_TIMEZONE_FILE=\"${WINPR_TIMEZONE_FILE}\"")
|
||||
|
||||
if(FREEBSD)
|
||||
find_path(EPOLLSHIM_INCLUDE_DIR NAMES sys/epoll.h sys/timerfd.h HINTS /usr/local/include/libepoll-shim)
|
||||
find_library(EPOLLSHIM_LIBS NAMES epoll-shim libepoll-shim HINTS /usr/local/lib)
|
||||
endif()
|
||||
endif()
|
||||
61
third_party/FreeRDP/cmake/PreventInSourceBuilds.cmake
vendored
Normal file
61
third_party/FreeRDP/cmake/PreventInSourceBuilds.cmake
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
# PreventInSourceBuilds
|
||||
# ---------------------
|
||||
#
|
||||
# Prevent in-source builds
|
||||
#
|
||||
# It is generally acknowledged that it is preferable to run CMake out of source,
|
||||
# in a dedicated build directory. To prevent users from accidentally running
|
||||
# CMake in the source directory, just include this module.
|
||||
|
||||
option(ALLOW_IN_SOURCE_BUILD "[deprecated] Allow building in source tree" OFF)
|
||||
|
||||
if(ALLOW_IN_SOURCE_BUILD)
|
||||
set(CMAKE_DISABLE_SOURCE_CHANGES OFF CACHE INTERNAL "policy")
|
||||
set(CMAKE_DISABLE_IN_SOURCE_BUILD OFF CACHE INTERNAL "policy")
|
||||
if("${srcdir}" STREQUAL "${bindir}")
|
||||
message(WARNING "Running in-source-tree build [ALLOW_IN_SOURCE_BUILD=ON]")
|
||||
endif()
|
||||
else()
|
||||
set(CMAKE_DISABLE_SOURCE_CHANGES ON CACHE INTERNAL "policy")
|
||||
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON CACHE INTERNAL "policy")
|
||||
|
||||
# make sure the user doesn't play dirty with symlinks
|
||||
get_filename_component(srcdir "${CMAKE_SOURCE_DIR}" REALPATH)
|
||||
get_filename_component(bindir "${CMAKE_BINARY_DIR}" REALPATH)
|
||||
|
||||
# disallow in-source builds
|
||||
if("${srcdir}" STREQUAL "${bindir}")
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"\
|
||||
|
||||
CMake must not to be run in the source directory. \
|
||||
Rather create a dedicated build directory and run CMake there. \
|
||||
CMake now already created some files, to clean up after this aborted in-source compilation:
|
||||
rm -r CMakeCache.txt CMakeFiles
|
||||
or
|
||||
git clean -xdf
|
||||
|
||||
If you happen to require in-source-tree builds for some reason rerun with -DALLOW_IN_SOURCE_BUILD=ON
|
||||
"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Check for remnants of in source builds
|
||||
if(EXISTS "${CMAKE_SOURCE_DIR}/CMakeCache.txt" OR EXISTS "${CMAKE_SOURCE_DIR}/CMakeFiles")
|
||||
message(
|
||||
FATAL_ERROR
|
||||
" \
|
||||
|
||||
Remnants of in source CMake run detected, aborting!
|
||||
|
||||
To clean up after this aborted in-source compilation:
|
||||
rm -r CMakeCache.txt CMakeFiles
|
||||
or
|
||||
git clean -xdf
|
||||
|
||||
If you happen to require in-source-tree builds for some reason rerun with -DALLOW_IN_SOURCE_BUILD=ON
|
||||
"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
3
third_party/FreeRDP/cmake/ProjectCStandard.cmake
vendored
Normal file
3
third_party/FreeRDP/cmake/ProjectCStandard.cmake
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
set(CMAKE_C_STANDARD 11 CACHE STRING "project default")
|
||||
set(CMAKE_C_STANDARD_REQUIRED ON CACHE BOOL "project default")
|
||||
set(CMAKE_C_EXTENSIONS ON CACHE BOOL "project default")
|
||||
3
third_party/FreeRDP/cmake/ProjectCXXStandard.cmake
vendored
Normal file
3
third_party/FreeRDP/cmake/ProjectCXXStandard.cmake
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
set(CMAKE_CXX_STANDARD 17 CACHE STRING "project default")
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON CACHE BOOL "project default")
|
||||
set(CMAKE_CXX_EXTENSIONS ON CACHE BOOL "project default")
|
||||
19
third_party/FreeRDP/cmake/ProxyModuleConfig.cmake
vendored
Normal file
19
third_party/FreeRDP/cmake/ProxyModuleConfig.cmake
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
macro(generate_proxy_module_config)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
string(REPLACE "-" "_" PROJECT_SHORT_NAME_UNDERSCORE ${PROJECT_NAME})
|
||||
string(REPLACE "proxy_" "" PROJECT_SHORT_NAME_UNDERSCORE ${PROJECT_SHORT_NAME_UNDERSCORE})
|
||||
string(REPLACE "_plugin" "" PROJECT_SHORT_NAME_UNDERSCORE ${PROJECT_SHORT_NAME_UNDERSCORE})
|
||||
|
||||
set(PROJECT_LIBRARY_NAME "${CMAKE_STATIC_LIBRARY_PREFIX}${PROJECT_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
|
||||
include(pkg-config-install-prefix)
|
||||
cleaning_configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../freerdp-proxy-module.pc.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/freerdp-${PROJECT_NAME}${FREERDP_VERSION_MAJOR}.pc @ONLY
|
||||
)
|
||||
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp-${PROJECT_NAME}${FREERDP_VERSION_MAJOR}.pc
|
||||
DESTINATION ${PKG_CONFIG_PC_INSTALL_DIR}
|
||||
)
|
||||
endif()
|
||||
endmacro()
|
||||
3
third_party/FreeRDP/cmake/SetFreeRDPCMakeInstallDir.cmake
vendored
Normal file
3
third_party/FreeRDP/cmake/SetFreeRDPCMakeInstallDir.cmake
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
function(SetFreeRDPCMakeInstallDir SETVAR subdir)
|
||||
set(${SETVAR} "${CMAKE_INSTALL_LIBDIR}/cmake/${subdir}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
14
third_party/FreeRDP/cmake/ShowCMakeVars.cmake
vendored
Normal file
14
third_party/FreeRDP/cmake/ShowCMakeVars.cmake
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
function(ShowCMakeVars)
|
||||
get_cmake_property(_variableNames VARIABLES)
|
||||
list(SORT _variableNames)
|
||||
foreach(_variableName ${_variableNames})
|
||||
if(ARGV0)
|
||||
unset(MATCHED)
|
||||
string(REGEX MATCH ${ARGV0} MATCHED ${_variableName})
|
||||
if(NOT MATCHED)
|
||||
continue()
|
||||
endif()
|
||||
endif()
|
||||
message(STATUS "${_variableName}=${${_variableName}}")
|
||||
endforeach()
|
||||
endfunction()
|
||||
15
third_party/FreeRDP/cmake/WarnUnmaintained.cmake
vendored
Normal file
15
third_party/FreeRDP/cmake/WarnUnmaintained.cmake
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
macro(warn_unmaintained name)
|
||||
message(WARNING "[unmaintained] ${name} is unmaintained!")
|
||||
message(WARNING "[unmaintained] use at your own risk!")
|
||||
message(
|
||||
WARNING
|
||||
"[unmaintained] If problems occur please check https://github.com/FreeRDP/FreeRDP/issues for known issues, but be prepared to fix them on your own!"
|
||||
)
|
||||
message(WARNING "[unmaintained] Developers hang out in https://matrix.to/#/#FreeRDP:matrix.org?via=matrix.org")
|
||||
message(
|
||||
WARNING
|
||||
"[unmaintained] - don't hesitate to ask some questions. (replies might take some time depending on your timezone)"
|
||||
)
|
||||
message(WARNING "[unmaintained] - if you intend using this component write us a message")
|
||||
message(WARNING "[unmaintained] use ${ARGN} to disable")
|
||||
endmacro()
|
||||
41
third_party/FreeRDP/cmake/WebView2.cmake
vendored
Normal file
41
third_party/FreeRDP/cmake/WebView2.cmake
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
if(WIN32)
|
||||
# WebView2 SDK
|
||||
set(WEBVIEW2_VERSION "1.0.2535.41")
|
||||
set(WEBVIEW2_URL "https://www.nuget.org/api/v2/package/Microsoft.Web.WebView2/${WEBVIEW2_VERSION}")
|
||||
set(WEBVIEW2_SHA256 "c9c5518e4d7efa9079ad87bafb64f3c8e8edca0e95d34df878034b880a7af56b")
|
||||
set(WEBVIEW2_DEFAULT_PACKAGE_DIR "${CMAKE_CURRENT_BINARY_DIR}/packages/Microsoft.Web.WebView2.${WEBVIEW2_VERSION}")
|
||||
|
||||
if(NOT EXISTS ${WEBVIEW2_PACKAGE_DIR})
|
||||
unset(WEBVIEW2_PACKAGE_DIR CACHE)
|
||||
endif()
|
||||
find_path(WEBVIEW2_PACKAGE_DIR NAMES "build/native/include/WebView2.h"
|
||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH # don't prepend CMAKE_PREFIX
|
||||
)
|
||||
if(NOT WEBVIEW2_PACKAGE_DIR)
|
||||
message(WARNING "WebView2 SDK not found locally, downloading ${WEBVIEW2_VERSION} ...")
|
||||
set(WEBVIEW2_PACKAGE_DIR ${WEBVIEW2_DEFAULT_PACKAGE_DIR} CACHE PATH "WebView2 SDK PATH" FORCE)
|
||||
file(DOWNLOAD ${WEBVIEW2_URL} ${CMAKE_CURRENT_BINARY_DIR}/webview2.nuget EXPECTED_HASH SHA256=${WEBVIEW2_SHA256})
|
||||
file(MAKE_DIRECTORY ${WEBVIEW2_PACKAGE_DIR})
|
||||
execute_process(
|
||||
COMMAND "${CMAKE_COMMAND}" -E tar x "${CMAKE_CURRENT_BINARY_DIR}/webview2.nuget"
|
||||
WORKING_DIRECTORY "${WEBVIEW2_PACKAGE_DIR}"
|
||||
)
|
||||
endif()
|
||||
set(WEBVIEW2_PACKAGE_DIR ${WEBVIEW2_PACKAGE_DIR} CACHE INTERNAL "" FORCE)
|
||||
endif()
|
||||
|
||||
function(target_link_webview2 target)
|
||||
if(WIN32)
|
||||
if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID)
|
||||
set(ARCH ${CMAKE_CXX_COMPILER_ARCHITECTURE_ID})
|
||||
elseif(CMAKE_C_COMPILER_ARCHITECTURE_ID)
|
||||
set(ARCH ${CMAKE_C_COMPILER_ARCHITECTURE_ID})
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown CMAKE_<lang>_COMPILER_ARCHITECTURE_ID")
|
||||
endif()
|
||||
target_include_directories(${target} PRIVATE "${WEBVIEW2_PACKAGE_DIR}/build/native/include")
|
||||
target_link_libraries(
|
||||
${target} PRIVATE shlwapi version "${WEBVIEW2_PACKAGE_DIR}/build/native/${ARCH}/WebView2LoaderStatic.lib"
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
35
third_party/FreeRDP/cmake/WindowsDLLVersion.rc.in
vendored
Normal file
35
third_party/FreeRDP/cmake/WindowsDLLVersion.rc.in
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
#include <winresrc.h>
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION @RC_VERSION_MAJOR@,@RC_VERSION_MINOR@,@RC_VERSION_BUILD@,@RC_VERSION_PATCH@
|
||||
PRODUCTVERSION @RC_VERSION_MAJOR@,@RC_VERSION_MINOR@,@RC_VERSION_BUILD@,@RC_VERSION_PATCH@
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "@RC_VERSION_VENDOR@"
|
||||
VALUE "FileDescription", "@RC_VERSION_DESCRIPTION@"
|
||||
VALUE "FileVersion", "@RC_VERSION_MAJOR@,@RC_VERSION_MINOR@,@RC_VERSION_PATCH@,@RC_VERSION_BUILD@"
|
||||
VALUE "InternalName", "@RC_VERSION_FILE@"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2011-@RC_VERSION_YEAR@"
|
||||
VALUE "OriginalFilename", "@RC_VERSION_FILE@"
|
||||
VALUE "ProductName", "@RC_VERSION_PRODUCT@"
|
||||
VALUE "ProductVersion", "@RC_VERSION_MAJOR@,@RC_VERSION_MINOR@,@RC_VERSION_BUILD@,@RC_VERSION_PATCH@"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
977
third_party/FreeRDP/cmake/ios.toolchain.cmake
vendored
Normal file
977
third_party/FreeRDP/cmake/ios.toolchain.cmake
vendored
Normal file
@@ -0,0 +1,977 @@
|
||||
# This file is part of the ios-cmake project. It was retrieved from
|
||||
# https://github.com/leetal/ios-cmake.git, which is a fork of
|
||||
# https://github.com/gerstrong/ios-cmake.git, which is a fork of
|
||||
# https://github.com/cristeab/ios-cmake.git, which is a fork of
|
||||
# https://code.google.com/p/ios-cmake/. Which in turn is based off of
|
||||
# the Platform/Darwin.cmake and Platform/UnixPaths.cmake files which
|
||||
# are included with CMake 2.8.4
|
||||
#
|
||||
# The ios-cmake project is licensed under the new BSD license.
|
||||
#
|
||||
# Copyright (c) 2014, Bogdan Cristea and LTE Engineering Software,
|
||||
# Kitware, Inc., Insight Software Consortium. All rights reserved.
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# 3. Neither the name of the copyright holder nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# This file is based off of the Platform/Darwin.cmake and
|
||||
# Platform/UnixPaths.cmake files which are included with CMake 2.8.4
|
||||
# It has been altered for iOS development.
|
||||
#
|
||||
# Updated by Alex Stewart (alexs.mac@gmail.com)
|
||||
#
|
||||
# *****************************************************************************
|
||||
# Now maintained by Alexander Widerberg (widerbergaren [at] gmail.com)
|
||||
# under the BSD-3-Clause license
|
||||
# https://github.com/leetal/ios-cmake
|
||||
# *****************************************************************************
|
||||
#
|
||||
# INFORMATION / HELP
|
||||
#
|
||||
# The following options control the behaviour of this toolchain:
|
||||
#
|
||||
# PLATFORM: (default "OS64")
|
||||
# OS = Build for iPhoneOS.
|
||||
# OS64 = Build for arm64 iphoneOS.
|
||||
# OS64COMBINED = Build for arm64 x86_64 iphoneOS. Combined into FAT STATIC lib (supported on 3.14+ of CMakewith "-G Xcode" argument ONLY)
|
||||
# SIMULATOR = Build for x86 i386 iphoneOS Simulator.
|
||||
# SIMULATOR64 = Build for x86_64 iphoneOS Simulator.
|
||||
# SIMULATORARM64 = Build for arm64 iphoneOS Simulator.
|
||||
# TVOS = Build for arm64 tvOS.
|
||||
# TVOSCOMBINED = Build for arm64 x86_64 tvOS. Combined into FAT STATIC lib (supported on 3.14+ of CMake with "-G Xcode" argument ONLY)
|
||||
# SIMULATOR_TVOS = Build for x86_64 tvOS Simulator.
|
||||
# WATCHOS = Build for armv7k arm64_32 for watchOS.
|
||||
# WATCHOSCOMBINED = Build for armv7k arm64_32 x86_64 watchOS. Combined into FAT STATIC lib (supported on 3.14+ of CMake with "-G Xcode" argument ONLY)
|
||||
# SIMULATOR_WATCHOS = Build for x86_64 for watchOS Simulator.
|
||||
# MAC = Build for x86_64 macOS.
|
||||
# MAC_ARM64 = Build for Apple Silicon macOS.
|
||||
# MAC_CATALYST = Build for x86_64 macOS with Catalyst support (iOS toolchain on macOS).
|
||||
# Note: The build argument "MACOSX_DEPLOYMENT_TARGET" can be used to control min-version of macOS
|
||||
# MAC_CATALYST_ARM64 = Build for Apple Silicon macOS with Catalyst support (iOS toolchain on macOS).
|
||||
# Note: The build argument "MACOSX_DEPLOYMENT_TARGET" can be used to control min-version of macOS
|
||||
#
|
||||
# CMAKE_OSX_SYSROOT: Path to the SDK to use. By default this is
|
||||
# automatically determined from PLATFORM and xcodebuild, but
|
||||
# can also be manually specified (although this should not be required).
|
||||
#
|
||||
# CMAKE_DEVELOPER_ROOT: Path to the Developer directory for the platform
|
||||
# being compiled for. By default this is automatically determined from
|
||||
# CMAKE_OSX_SYSROOT, but can also be manually specified (although this should
|
||||
# not be required).
|
||||
#
|
||||
# DEPLOYMENT_TARGET: Minimum SDK version to target. Default 2.0 on watchOS and 9.0 on tvOS+iOS
|
||||
#
|
||||
# ENABLE_BITCODE: (1|0) Enables or disables bitcode support. Default 1 (true)
|
||||
#
|
||||
# ENABLE_ARC: (1|0) Enables or disables ARC support. Default 1 (true, ARC enabled by default)
|
||||
#
|
||||
# ENABLE_VISIBILITY: (1|0) Enables or disables symbol visibility support. Default 0 (false, visibility hidden by default)
|
||||
#
|
||||
# ENABLE_STRICT_TRY_COMPILE: (1|0) Enables or disables strict try_compile() on all Check* directives (will run linker
|
||||
# to actually check if linking is possible). Default 0 (false, will set CMAKE_TRY_COMPILE_TARGET_TYPE to STATIC_LIBRARY)
|
||||
#
|
||||
# ARCHS: (armv7 armv7s armv7k arm64 arm64_32 i386 x86_64) If specified, will override the default architectures for the given PLATFORM
|
||||
# OS = armv7 armv7s arm64 (if applicable)
|
||||
# OS64 = arm64 (if applicable)
|
||||
# SIMULATOR = i386
|
||||
# SIMULATOR64 = x86_64
|
||||
# SIMULATORARM64 = arm64
|
||||
# TVOS = arm64
|
||||
# SIMULATOR_TVOS = x86_64 (i386 has since long been deprecated)
|
||||
# WATCHOS = armv7k arm64_32 (if applicable)
|
||||
# SIMULATOR_WATCHOS = x86_64 (i386 has since long been deprecated)
|
||||
# MAC = x86_64
|
||||
# MAC_ARM64 = arm64
|
||||
# MAC_CATALYST = x86_64
|
||||
# MAC_CATALYST_ARM64 = arm64
|
||||
#
|
||||
# This toolchain defines the following properties (available via get_property()) for use externally:
|
||||
#
|
||||
# PLATFORM: The currently targeted platform.
|
||||
# XCODE_VERSION: Version number (not including Build version) of Xcode detected.
|
||||
# SDK_VERSION: Version of SDK being used.
|
||||
# OSX_ARCHITECTURES: Architectures being compiled for (generated from PLATFORM).
|
||||
# APPLE_TARGET_TRIPLE: Used by autoconf build systems. NOTE: If "ARCHS" are overridden, this will *NOT* be set!
|
||||
#
|
||||
# This toolchain defines the following macros for use externally:
|
||||
#
|
||||
# set_xcode_property (TARGET XCODE_PROPERTY XCODE_VALUE XCODE_VARIANT)
|
||||
# A convenience macro for setting xcode specific properties on targets.
|
||||
# Available variants are: All, Release, RelWithDebInfo, Debug, MinSizeRel
|
||||
# example: set_xcode_property (myioslib IPHONEOS_DEPLOYMENT_TARGET "3.1" "all").
|
||||
#
|
||||
# find_host_package (PROGRAM ARGS)
|
||||
# A macro used to find executable programs on the host system, not within the
|
||||
# environment. Thanks to the android-cmake project for providing the
|
||||
# command.
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
# CMake invokes the toolchain file twice during the first build, but only once during subsequent rebuilds.
|
||||
if(DEFINED ENV{_IOS_TOOLCHAIN_HAS_RUN})
|
||||
return()
|
||||
endif()
|
||||
set(ENV{_IOS_TOOLCHAIN_HAS_RUN} true)
|
||||
|
||||
###############################################################################
|
||||
# OPTIONS #
|
||||
###############################################################################
|
||||
|
||||
option(DROP_32_BIT "Drops the 32-bit targets universally." YES)
|
||||
|
||||
###############################################################################
|
||||
# END OPTIONS #
|
||||
###############################################################################
|
||||
|
||||
# List of supported platform values
|
||||
list(
|
||||
APPEND
|
||||
_supported_platforms
|
||||
"OS"
|
||||
"OS64"
|
||||
"OS64COMBINED"
|
||||
"SIMULATOR"
|
||||
"SIMULATOR64"
|
||||
"SIMULATORARM64"
|
||||
"TVOS"
|
||||
"TVOSCOMBINED"
|
||||
"SIMULATOR_TVOS"
|
||||
"WATCHOS"
|
||||
"WATCHOSCOMBINED"
|
||||
"SIMULATOR_WATCHOS"
|
||||
"MAC"
|
||||
"MAC_ARM64"
|
||||
"MAC_CATALYST"
|
||||
"MAC_CATALYST_ARM64"
|
||||
)
|
||||
|
||||
# Cache what generator is used
|
||||
set(USED_CMAKE_GENERATOR "${CMAKE_GENERATOR}")
|
||||
|
||||
# Check if using a CMake version capable of building combined FAT builds (simulator and target slices combined in one static lib)
|
||||
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.14")
|
||||
set(MODERN_CMAKE YES)
|
||||
endif()
|
||||
|
||||
# Get the Xcode version being used.
|
||||
# Problem: CMake runs toolchain files multiple times, but can't read cache variables on some runs.
|
||||
# Workaround: On first run (in which cache variables are always accessible), set an intermediary environment variable.
|
||||
#
|
||||
# NOTE: This pattern is used i many places in this toolchain to speed up checks of all sorts
|
||||
if(DEFINED XCODE_VERSION_INT)
|
||||
# Environment variables are always preserved.
|
||||
set(ENV{_XCODE_VERSION_INT} "${XCODE_VERSION_INT}")
|
||||
elseif(DEFINED ENV{_XCODE_VERSION_INT})
|
||||
set(XCODE_VERSION_INT "$ENV{_XCODE_VERSION_INT}")
|
||||
elseif(NOT DEFINED XCODE_VERSION_INT)
|
||||
find_program(XCODEBUILD_EXECUTABLE xcodebuild)
|
||||
if(NOT XCODEBUILD_EXECUTABLE)
|
||||
message(FATAL_ERROR "xcodebuild not found. Please install either the standalone commandline tools or Xcode.")
|
||||
endif()
|
||||
execute_process(
|
||||
COMMAND ${XCODEBUILD_EXECUTABLE} -version OUTPUT_VARIABLE XCODE_VERSION_INT ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
string(REGEX MATCH "Xcode [0-9\\.]+" XCODE_VERSION_INT "${XCODE_VERSION_INT}")
|
||||
string(REGEX REPLACE "Xcode ([0-9\\.]+)" "\\1" XCODE_VERSION_INT "${XCODE_VERSION_INT}")
|
||||
set(XCODE_VERSION_INT "${XCODE_VERSION_INT}" CACHE INTERNAL "")
|
||||
endif()
|
||||
|
||||
# Assuming that xcode 12.0 is installed you most probably have ios sdk 14.0 or later installed (tested on Big Sur)
|
||||
# if you don't set a deployment target it will be set the way you only get 64-bit builds
|
||||
if(NOT DEFINED DEPLOYMENT_TARGET AND XCODE_VERSION_INT VERSION_GREATER 12.0)
|
||||
# Temporarily fix the arm64 issues in CMake install-combined by excluding arm64 for simulator builds (needed for Apple Silicon...)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_EXCLUDED_ARCHS[sdk=iphonesimulator*] "arm64")
|
||||
endif()
|
||||
|
||||
# Check if the platform variable is set
|
||||
if(DEFINED PLATFORM)
|
||||
# Environment variables are always preserved.
|
||||
set(ENV{_PLATFORM} "${PLATFORM}")
|
||||
elseif(DEFINED ENV{_PLATFORM})
|
||||
set(PLATFORM "$ENV{_PLATFORM}")
|
||||
elseif(NOT DEFINED PLATFORM)
|
||||
message(
|
||||
FATAL_ERROR "PLATFORM argument not set. Bailing configure since I don't know what target you want to build for!"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(PLATFORM MATCHES ".*COMBINED" AND NOT CMAKE_GENERATOR MATCHES "Xcode")
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"The combined builds support requires Xcode to be used as generator via '-G Xcode' command-line argument in CMake"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Safeguard that the platform value is set and is one of the supported values
|
||||
list(FIND _supported_platforms ${PLATFORM} contains_PLATFORM)
|
||||
if("${contains_PLATFORM}" EQUAL "-1")
|
||||
string(REPLACE ";" "\n * " _supported_platforms_formatted "${_supported_platforms}")
|
||||
message(FATAL_ERROR " Invalid PLATFORM specified! Current value: ${PLATFORM}.\n"
|
||||
" Supported PLATFORM values: \n * ${_supported_platforms_formatted}"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Check if Apple Silicon is supported
|
||||
if(PLATFORM MATCHES "^(MAC_ARM64)$|^(MAC_CATALYST_ARM64)$" AND ${CMAKE_VERSION} VERSION_LESS "3.19.5")
|
||||
message(FATAL_ERROR "Apple Silicon builds requires a minimum of CMake 3.19.5")
|
||||
endif()
|
||||
|
||||
# Touch toolchain variable to suppress "unused variable" warning.
|
||||
# This happens if CMake is invoked with the same command line the second time.
|
||||
if(CMAKE_TOOLCHAIN_FILE)
|
||||
|
||||
endif()
|
||||
|
||||
# Fix for PThread library not in path
|
||||
set(CMAKE_THREAD_LIBS_INIT "-lpthread")
|
||||
set(CMAKE_HAVE_THREADS_LIBRARY 1)
|
||||
set(CMAKE_USE_WIN32_THREADS_INIT 0)
|
||||
set(CMAKE_USE_PTHREADS_INIT 1)
|
||||
|
||||
# Specify minimum version of deployment target.
|
||||
if(NOT DEFINED DEPLOYMENT_TARGET)
|
||||
if(PLATFORM MATCHES "WATCHOS")
|
||||
# Unless specified, SDK version 4.0 is used by default as minimum target version (watchOS).
|
||||
set(DEPLOYMENT_TARGET "4.0")
|
||||
elseif(PLATFORM STREQUAL "MAC")
|
||||
# Unless specified, SDK version 10.13 (High sierra) is used by default as minimum target version (macos).
|
||||
set(DEPLOYMENT_TARGET "10.13")
|
||||
elseif(PLATFORM STREQUAL "MAC_ARM64")
|
||||
# Unless specified, SDK version 11.0 (Big Sur) is used by default as minimum target version (macos on arm).
|
||||
set(DEPLOYMENT_TARGET "11.0")
|
||||
elseif(PLATFORM STREQUAL "MAC_CATALYST" OR PLATFORM STREQUAL "MAC_CATALYST_ARM64")
|
||||
# Unless specified, SDK version 13.0 is used by default as minimum target version (mac catalyst minimum requirement).
|
||||
set(DEPLOYMENT_TARGET "13.0")
|
||||
else()
|
||||
# Unless specified, SDK version 11.0 is used by default as minimum target version (iOS, tvOS).
|
||||
set(DEPLOYMENT_TARGET "11.0")
|
||||
endif()
|
||||
message(STATUS "[DEFAULTS] Using the default min-version since DEPLOYMENT_TARGET not provided!")
|
||||
elseif(DEFINED DEPLOYMENT_TARGET AND PLATFORM MATCHES "^MAC_CATALYST" AND ${DEPLOYMENT_TARGET} VERSION_LESS "13.0")
|
||||
message(FATAL_ERROR "Mac Catalyst builds requires a minimum deployment target of 13.0!")
|
||||
endif()
|
||||
|
||||
# Store the DEPLOYMENT_TARGET in the cache
|
||||
set(DEPLOYMENT_TARGET "${DEPLOYMENT_TARGET}" CACHE INTERNAL "")
|
||||
|
||||
# Handle the case where we are targeting iOS and a version above 10.3.4 (32-bit support dropped officially)
|
||||
if(PLATFORM STREQUAL "OS" AND DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 10.3.4)
|
||||
set(PLATFORM "OS64")
|
||||
message(STATUS "Targeting minimum SDK version ${DEPLOYMENT_TARGET}. Dropping 32-bit support.")
|
||||
elseif(PLATFORM STREQUAL "SIMULATOR" AND DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 10.3.4)
|
||||
set(PLATFORM "SIMULATOR64")
|
||||
message(STATUS "Targeting minimum SDK version ${DEPLOYMENT_TARGET}. Dropping 32-bit support.")
|
||||
endif()
|
||||
|
||||
set(PLATFORM_INT "${PLATFORM}")
|
||||
|
||||
if(DEFINED ARCHS)
|
||||
string(REPLACE ";" "-" ARCHS_SPLIT "${ARCHS}")
|
||||
endif()
|
||||
|
||||
# Determine the platform name and architectures for use in xcodebuild commands
|
||||
# from the specified PLATFORM_INT name.
|
||||
if(PLATFORM_INT STREQUAL "OS")
|
||||
set(SDK_NAME iphoneos)
|
||||
if(NOT ARCHS)
|
||||
set(ARCHS armv7 armv7s arm64)
|
||||
set(APPLE_TARGET_TRIPLE_INT arm-apple-ios$${DEPLOYMENT_TARGET})
|
||||
else()
|
||||
set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-ios${DEPLOYMENT_TARGET})
|
||||
endif()
|
||||
elseif(PLATFORM_INT STREQUAL "OS64")
|
||||
set(SDK_NAME iphoneos)
|
||||
if(NOT ARCHS)
|
||||
if(XCODE_VERSION_INT VERSION_GREATER 10.0)
|
||||
set(ARCHS arm64)
|
||||
|
||||
# Add arm64e when Apple have fixed the integration issues with it, libarclite_iphoneos.a is currently missung bitcode markers for example
|
||||
else()
|
||||
set(ARCHS arm64)
|
||||
endif()
|
||||
set(APPLE_TARGET_TRIPLE_INT aarch64-apple-ios${DEPLOYMENT_TARGET})
|
||||
else()
|
||||
set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-ios${DEPLOYMENT_TARGET})
|
||||
endif()
|
||||
elseif(PLATFORM_INT STREQUAL "OS64COMBINED")
|
||||
set(SDK_NAME iphoneos)
|
||||
if(MODERN_CMAKE)
|
||||
if(NOT ARCHS)
|
||||
if(XCODE_VERSION_INT VERSION_GREATER 10.0)
|
||||
set(ARCHS arm64 x86_64)
|
||||
|
||||
# Add arm64e when Apple have fixed the integration issues with it, libarclite_iphoneos.a is currently missung bitcode markers for example
|
||||
set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] "arm64")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] "x86_64")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] "arm64")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] "x86_64")
|
||||
else()
|
||||
set(ARCHS arm64 x86_64)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] "arm64")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] "x86_64")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] "arm64")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] "x86_64")
|
||||
endif()
|
||||
set(APPLE_TARGET_TRIPLE_INT aarch64-x86_64-apple-ios${DEPLOYMENT_TARGET})
|
||||
else()
|
||||
set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-ios${DEPLOYMENT_TARGET})
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "Please make sure that you are running CMake 3.14+ to make the OS64COMBINED setting work")
|
||||
endif()
|
||||
elseif(PLATFORM_INT STREQUAL "SIMULATOR")
|
||||
set(SDK_NAME iphonesimulator)
|
||||
if(NOT ARCHS)
|
||||
set(ARCHS i386)
|
||||
set(APPLE_TARGET_TRIPLE_INT i386-apple-ios${DEPLOYMENT_TARGET}-simulator)
|
||||
else()
|
||||
set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-ios${DEPLOYMENT_TARGET}-simulator)
|
||||
endif()
|
||||
message(DEPRECATION "SIMULATOR IS DEPRECATED. Consider using SIMULATOR64 instead.")
|
||||
elseif(PLATFORM_INT STREQUAL "SIMULATOR64")
|
||||
set(SDK_NAME iphonesimulator)
|
||||
if(NOT ARCHS)
|
||||
set(ARCHS x86_64)
|
||||
set(APPLE_TARGET_TRIPLE_INT x86_64-apple-ios${DEPLOYMENT_TARGET}-simulator)
|
||||
else()
|
||||
set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-ios${DEPLOYMENT_TARGET}-simulator)
|
||||
endif()
|
||||
elseif(PLATFORM_INT STREQUAL "SIMULATORARM64")
|
||||
set(SDK_NAME iphonesimulator)
|
||||
if(NOT ARCHS)
|
||||
set(ARCHS arm64)
|
||||
set(APPLE_TARGET_TRIPLE_INT aarch64-apple-ios${DEPLOYMENT_TARGET}-simulator)
|
||||
else()
|
||||
set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-ios${DEPLOYMENT_TARGET}-simulator)
|
||||
endif()
|
||||
elseif(PLATFORM_INT STREQUAL "TVOS")
|
||||
set(SDK_NAME appletvos)
|
||||
if(NOT ARCHS)
|
||||
set(ARCHS arm64)
|
||||
set(APPLE_TARGET_TRIPLE_INT aarch64-apple-tvos${DEPLOYMENT_TARGET})
|
||||
else()
|
||||
set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-tvos${DEPLOYMENT_TARGET})
|
||||
endif()
|
||||
elseif(PLATFORM_INT STREQUAL "TVOSCOMBINED")
|
||||
set(SDK_NAME appletvos)
|
||||
if(MODERN_CMAKE)
|
||||
if(NOT ARCHS)
|
||||
set(ARCHS arm64 x86_64)
|
||||
set(APPLE_TARGET_TRIPLE_INT aarch64-x86_64-apple-tvos${DEPLOYMENT_TARGET})
|
||||
set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=appletvos*] "arm64")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=appletvsimulator*] "x86_64")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=appletvos*] "arm64")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=appletvsimulator*] "x86_64")
|
||||
else()
|
||||
set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-tvos${DEPLOYMENT_TARGET})
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "Please make sure that you are running CMake 3.14+ to make the TVOSCOMBINED setting work")
|
||||
endif()
|
||||
elseif(PLATFORM_INT STREQUAL "SIMULATOR_TVOS")
|
||||
set(SDK_NAME appletvsimulator)
|
||||
if(NOT ARCHS)
|
||||
set(ARCHS x86_64)
|
||||
set(APPLE_TARGET_TRIPLE_INT x86_64-apple-tvos${DEPLOYMENT_TARGET}-simulator)
|
||||
else()
|
||||
set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-tvos${DEPLOYMENT_TARGET}-simulator)
|
||||
endif()
|
||||
elseif(PLATFORM_INT STREQUAL "WATCHOS")
|
||||
set(SDK_NAME watchos)
|
||||
if(NOT ARCHS)
|
||||
if(XCODE_VERSION_INT VERSION_GREATER 10.0)
|
||||
set(ARCHS armv7k arm64_32)
|
||||
set(APPLE_TARGET_TRIPLE_INT aarch64_32-apple-watchos${DEPLOYMENT_TARGET})
|
||||
else()
|
||||
set(ARCHS armv7k)
|
||||
set(APPLE_TARGET_TRIPLE_INT arm-apple-watchos${DEPLOYMENT_TARGET})
|
||||
endif()
|
||||
else()
|
||||
set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-watchos${DEPLOYMENT_TARGET})
|
||||
endif()
|
||||
elseif(PLATFORM_INT STREQUAL "WATCHOSCOMBINED")
|
||||
set(SDK_NAME watchos)
|
||||
if(MODERN_CMAKE)
|
||||
if(NOT ARCHS)
|
||||
if(XCODE_VERSION_INT VERSION_GREATER 10.0)
|
||||
set(ARCHS armv7k arm64_32 i386)
|
||||
set(APPLE_TARGET_TRIPLE_INT aarch64_32-i386-apple-watchos${DEPLOYMENT_TARGET})
|
||||
set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=watchos*] "armv7k arm64_32")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=watchsimulator*] "i386")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=watchos*] "armv7k arm64_32")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=watchsimulator*] "i386")
|
||||
else()
|
||||
set(ARCHS armv7k i386)
|
||||
set(APPLE_TARGET_TRIPLE_INT arm-i386-apple-watchos${DEPLOYMENT_TARGET})
|
||||
set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=watchos*] "armv7k")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=watchsimulator*] "i386")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=watchos*] "armv7k")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=watchsimulator*] "i386")
|
||||
endif()
|
||||
else()
|
||||
set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-watchos${DEPLOYMENT_TARGET})
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "Please make sure that you are running CMake 3.14+ to make the WATCHOSCOMBINED setting work")
|
||||
endif()
|
||||
elseif(PLATFORM_INT STREQUAL "SIMULATOR_WATCHOS")
|
||||
set(SDK_NAME watchsimulator)
|
||||
if(NOT ARCHS)
|
||||
set(ARCHS i386)
|
||||
set(APPLE_TARGET_TRIPLE_INT i386-apple-watchos${DEPLOYMENT_TARGET}-simulator)
|
||||
else()
|
||||
set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-watchos${DEPLOYMENT_TARGET}-simulator)
|
||||
endif()
|
||||
elseif(PLATFORM_INT STREQUAL "MAC" OR PLATFORM_INT STREQUAL "MAC_CATALYST")
|
||||
set(SDK_NAME macosx)
|
||||
if(NOT ARCHS)
|
||||
set(ARCHS x86_64)
|
||||
endif()
|
||||
string(REPLACE ";" "-" ARCHS_SPLIT "${ARCHS}")
|
||||
if(PLATFORM_INT STREQUAL "MAC")
|
||||
set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-macosx${DEPLOYMENT_TARGET})
|
||||
elseif(PLATFORM_INT STREQUAL "MAC_CATALYST")
|
||||
set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-ios${DEPLOYMENT_TARGET}-macabi)
|
||||
endif()
|
||||
elseif(PLATFORM_INT MATCHES "^(MAC_ARM64)$|^(MAC_CATALYST_ARM64)$")
|
||||
set(SDK_NAME macosx)
|
||||
if(NOT ARCHS)
|
||||
set(ARCHS arm64)
|
||||
endif()
|
||||
string(REPLACE ";" "-" ARCHS_SPLIT "${ARCHS}")
|
||||
if(PLATFORM_INT STREQUAL "MAC_ARM64")
|
||||
set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-macosx${DEPLOYMENT_TARGET})
|
||||
elseif(PLATFORM_INT STREQUAL "MAC_CATALYST_ARM64")
|
||||
set(APPLE_TARGET_TRIPLE_INT ${ARCHS_SPLIT}-apple-ios${DEPLOYMENT_TARGET}-macabi)
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "Invalid PLATFORM: ${PLATFORM_INT}")
|
||||
endif()
|
||||
|
||||
if(MODERN_CMAKE AND PLATFORM_INT MATCHES ".*COMBINED" AND NOT CMAKE_GENERATOR MATCHES "Xcode")
|
||||
message(FATAL_ERROR "The COMBINED options only work with Xcode generator, -G Xcode")
|
||||
endif()
|
||||
|
||||
if(CMAKE_GENERATOR MATCHES "Xcode" AND PLATFORM_INT MATCHES "^MAC_CATALYST")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_SUPPORTED_PLATFORMS "macosx")
|
||||
set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-maccatalyst")
|
||||
if(NOT DEFINED MACOSX_DEPLOYMENT_TARGET)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET "10.15")
|
||||
else()
|
||||
set(CMAKE_XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET "${MACOSX_DEPLOYMENT_TARGET}")
|
||||
endif()
|
||||
elseif(CMAKE_GENERATOR MATCHES "Xcode")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "${DEPLOYMENT_TARGET}")
|
||||
if(NOT PLATFORM_INT MATCHES ".*COMBINED")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=${SDK_NAME}*] "${ARCHS}")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=${SDK_NAME}*] "${ARCHS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# If user did not specify the SDK root to use, then query xcodebuild for it.
|
||||
if(DEFINED CMAKE_OSX_SYSROOT_INT)
|
||||
# Environment variables are always preserved.
|
||||
set(ENV{_CMAKE_OSX_SYSROOT_INT} "${CMAKE_OSX_SYSROOT_INT}")
|
||||
elseif(DEFINED ENV{_CMAKE_OSX_SYSROOT_INT})
|
||||
set(CMAKE_OSX_SYSROOT_INT "$ENV{_CMAKE_OSX_SYSROOT_INT}")
|
||||
elseif(NOT DEFINED CMAKE_OSX_SYSROOT_INT)
|
||||
execute_process(
|
||||
COMMAND ${XCODEBUILD_EXECUTABLE} -version -sdk ${SDK_NAME} Path OUTPUT_VARIABLE CMAKE_OSX_SYSROOT_INT
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_OSX_SYSROOT_INT AND NOT DEFINED CMAKE_OSX_SYSROOT)
|
||||
message(SEND_ERROR "Please make sure that Xcode is installed and that the toolchain"
|
||||
"is pointing to the correct path. Please run:"
|
||||
"sudo xcode-select -s /Applications/Xcode.app/Contents/Developer"
|
||||
"and see if that fixes the problem for you."
|
||||
)
|
||||
message(FATAL_ERROR "Invalid CMAKE_OSX_SYSROOT: ${CMAKE_OSX_SYSROOT} " "does not exist.")
|
||||
elseif(DEFINED CMAKE_OSX_SYSROOT_INT)
|
||||
set(CMAKE_OSX_SYSROOT_INT "${CMAKE_OSX_SYSROOT_INT}" CACHE INTERNAL "")
|
||||
# Specify the location or name of the platform SDK to be used in CMAKE_OSX_SYSROOT.
|
||||
set(CMAKE_OSX_SYSROOT "${CMAKE_OSX_SYSROOT_INT}" CACHE INTERNAL "")
|
||||
endif()
|
||||
|
||||
# Use bitcode or not
|
||||
if(NOT DEFINED ENABLE_BITCODE AND NOT ARCHS MATCHES "((^|;|, )(i386|x86_64))+")
|
||||
# Unless specified, enable bitcode support by default
|
||||
message(STATUS "[DEFAULTS] Enabling bitcode support by default. ENABLE_BITCODE not provided!")
|
||||
set(ENABLE_BITCODE TRUE)
|
||||
elseif(NOT DEFINED ENABLE_BITCODE)
|
||||
message(
|
||||
STATUS "[DEFAULTS] Disabling bitcode support by default on simulators. ENABLE_BITCODE not provided for override!"
|
||||
)
|
||||
set(ENABLE_BITCODE FALSE)
|
||||
endif()
|
||||
set(ENABLE_BITCODE_INT ${ENABLE_BITCODE} CACHE BOOL "Whether or not to enable bitcode" FORCE)
|
||||
# Use ARC or not
|
||||
if(NOT DEFINED ENABLE_ARC)
|
||||
# Unless specified, enable ARC support by default
|
||||
set(ENABLE_ARC TRUE)
|
||||
message(STATUS "[DEFAULTS] Enabling ARC support by default. ENABLE_ARC not provided!")
|
||||
endif()
|
||||
set(ENABLE_ARC_INT ${ENABLE_ARC} CACHE BOOL "Whether or not to enable ARC" FORCE)
|
||||
# Use hidden visibility or not
|
||||
if(NOT DEFINED ENABLE_VISIBILITY)
|
||||
# Unless specified, disable symbols visibility by default
|
||||
set(ENABLE_VISIBILITY FALSE)
|
||||
message(STATUS "[DEFAULTS] Hiding symbols visibility by default. ENABLE_VISIBILITY not provided!")
|
||||
endif()
|
||||
set(ENABLE_VISIBILITY_INT ${ENABLE_VISIBILITY}
|
||||
CACHE BOOL "Whether or not to hide symbols from the dynamic linker (-fvisibility=hidden)" FORCE
|
||||
)
|
||||
# Set strict compiler checks or not
|
||||
if(NOT DEFINED ENABLE_STRICT_TRY_COMPILE)
|
||||
# Unless specified, disable strict try_compile()
|
||||
set(ENABLE_STRICT_TRY_COMPILE FALSE)
|
||||
message(STATUS "[DEFAULTS] Using NON-strict compiler checks by default. ENABLE_STRICT_TRY_COMPILE not provided!")
|
||||
endif()
|
||||
set(ENABLE_STRICT_TRY_COMPILE_INT ${ENABLE_STRICT_TRY_COMPILE}
|
||||
CACHE BOOL "Whether or not to use strict compiler checks" FORCE
|
||||
)
|
||||
|
||||
# Get the SDK version information.
|
||||
if(DEFINED SDK_VERSION)
|
||||
# Environment variables are always preserved.
|
||||
set(ENV{_SDK_VERSION} "${SDK_VERSION}")
|
||||
elseif(DEFINED ENV{_SDK_VERSION})
|
||||
set(SDK_VERSION "$ENV{_SDK_VERSION}")
|
||||
elseif(NOT DEFINED SDK_VERSION)
|
||||
execute_process(
|
||||
COMMAND ${XCODEBUILD_EXECUTABLE} -sdk ${CMAKE_OSX_SYSROOT_INT} -version SDKVersion OUTPUT_VARIABLE SDK_VERSION
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
endif()
|
||||
|
||||
# Find the Developer root for the specific iOS platform being compiled for
|
||||
# from CMAKE_OSX_SYSROOT. Should be ../../ from SDK specified in
|
||||
# CMAKE_OSX_SYSROOT. There does not appear to be a direct way to obtain
|
||||
# this information from xcrun or xcodebuild.
|
||||
if(NOT DEFINED CMAKE_DEVELOPER_ROOT AND NOT CMAKE_GENERATOR MATCHES "Xcode")
|
||||
get_filename_component(PLATFORM_SDK_DIR ${CMAKE_OSX_SYSROOT_INT} PATH)
|
||||
get_filename_component(CMAKE_DEVELOPER_ROOT ${PLATFORM_SDK_DIR} PATH)
|
||||
if(NOT EXISTS "${CMAKE_DEVELOPER_ROOT}")
|
||||
message(FATAL_ERROR "Invalid CMAKE_DEVELOPER_ROOT: ${CMAKE_DEVELOPER_ROOT} does not exist.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Find the C & C++ compilers for the specified SDK.
|
||||
if(DEFINED CMAKE_C_COMPILER)
|
||||
# Environment variables are always preserved.
|
||||
set(ENV{_CMAKE_C_COMPILER} "${CMAKE_C_COMPILER}")
|
||||
elseif(DEFINED ENV{_CMAKE_C_COMPILER})
|
||||
set(CMAKE_C_COMPILER "$ENV{_CMAKE_C_COMPILER}")
|
||||
set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER})
|
||||
elseif(NOT DEFINED CMAKE_C_COMPILER)
|
||||
execute_process(
|
||||
COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT_INT} -find clang OUTPUT_VARIABLE CMAKE_C_COMPILER
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER})
|
||||
endif()
|
||||
if(DEFINED CMAKE_CXX_COMPILER)
|
||||
# Environment variables are always preserved.
|
||||
set(ENV{_CMAKE_CXX_COMPILER} "${CMAKE_CXX_COMPILER}")
|
||||
elseif(DEFINED ENV{_CMAKE_CXX_COMPILER})
|
||||
set(CMAKE_CXX_COMPILER "$ENV{_CMAKE_CXX_COMPILER}")
|
||||
elseif(NOT DEFINED CMAKE_CXX_COMPILER)
|
||||
execute_process(
|
||||
COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT_INT} -find clang++ OUTPUT_VARIABLE CMAKE_CXX_COMPILER
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
endif()
|
||||
# Find (Apple's) libtool.
|
||||
if(DEFINED BUILD_LIBTOOL)
|
||||
# Environment variables are always preserved.
|
||||
set(ENV{_BUILD_LIBTOOL} "${BUILD_LIBTOOL}")
|
||||
elseif(DEFINED ENV{_BUILD_LIBTOOL})
|
||||
set(BUILD_LIBTOOL "$ENV{_BUILD_LIBTOOL}")
|
||||
elseif(NOT DEFINED BUILD_LIBTOOL)
|
||||
execute_process(
|
||||
COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT_INT} -find libtool OUTPUT_VARIABLE BUILD_LIBTOOL
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
endif()
|
||||
# Find the toolchain's provided install_name_tool if none is found on the host
|
||||
if(DEFINED CMAKE_INSTALL_NAME_TOOL)
|
||||
# Environment variables are always preserved.
|
||||
set(ENV{_CMAKE_INSTALL_NAME_TOOL} "${CMAKE_INSTALL_NAME_TOOL}")
|
||||
elseif(DEFINED ENV{_CMAKE_INSTALL_NAME_TOOL})
|
||||
set(CMAKE_INSTALL_NAME_TOOL "$ENV{_CMAKE_INSTALL_NAME_TOOL}")
|
||||
elseif(NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
|
||||
execute_process(
|
||||
COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT_INT} -find install_name_tool OUTPUT_VARIABLE CMAKE_INSTALL_NAME_TOOL_INT
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
set(CMAKE_INSTALL_NAME_TOOL ${CMAKE_INSTALL_NAME_TOOL_INT} CACHE INTERNAL "")
|
||||
endif()
|
||||
|
||||
# Configure libtool to be used instead of ar + ranlib to build static libraries.
|
||||
# This is required on Xcode 7+, but should also work on previous versions of
|
||||
# Xcode.
|
||||
get_property(languages GLOBAL PROPERTY ENABLED_LANGUAGES)
|
||||
foreach(lang ${languages})
|
||||
set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "${BUILD_LIBTOOL} -static -o <TARGET> <LINK_FLAGS> <OBJECTS> " CACHE INTERNAL
|
||||
""
|
||||
)
|
||||
endforeach()
|
||||
|
||||
# CMake 3.14+ support building for iOS, watchOS and tvOS out of the box.
|
||||
if(MODERN_CMAKE)
|
||||
if(SDK_NAME MATCHES "iphone")
|
||||
set(CMAKE_SYSTEM_NAME iOS)
|
||||
elseif(SDK_NAME MATCHES "macosx")
|
||||
set(CMAKE_SYSTEM_NAME Darwin)
|
||||
elseif(SDK_NAME MATCHES "appletv")
|
||||
set(CMAKE_SYSTEM_NAME tvOS)
|
||||
elseif(SDK_NAME MATCHES "watch")
|
||||
set(CMAKE_SYSTEM_NAME watchOS)
|
||||
endif()
|
||||
# Provide flags for a combined FAT library build on newer CMake versions
|
||||
if(PLATFORM_INT MATCHES ".*COMBINED")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH "NO")
|
||||
set(CMAKE_IOS_INSTALL_COMBINED YES)
|
||||
message(STATUS "Will combine built (static) artifacts into FAT lib...")
|
||||
endif()
|
||||
elseif(NOT DEFINED CMAKE_SYSTEM_NAME AND ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.10")
|
||||
# Legacy code path prior to CMake 3.14 or fallback if no CMAKE_SYSTEM_NAME specified
|
||||
set(CMAKE_SYSTEM_NAME iOS)
|
||||
elseif(NOT DEFINED CMAKE_SYSTEM_NAME)
|
||||
# Legacy code path prior to CMake 3.14 or fallback if no CMAKE_SYSTEM_NAME specified
|
||||
set(CMAKE_SYSTEM_NAME Darwin)
|
||||
endif()
|
||||
# Standard settings.
|
||||
set(CMAKE_SYSTEM_VERSION ${SDK_VERSION} CACHE INTERNAL "")
|
||||
set(UNIX TRUE CACHE BOOL "")
|
||||
set(APPLE TRUE CACHE BOOL "")
|
||||
if(PLATFORM STREQUAL "MAC" OR PLATFORM STREQUAL "MAC_ARM64")
|
||||
set(IOS FALSE CACHE BOOL "")
|
||||
set(MACOS TRUE CACHE BOOL "")
|
||||
elseif(PLATFORM STREQUAL "MAC_CATALYST" OR PLATFORM STREQUAL "MAC_CATALYST_ARM64")
|
||||
set(IOS TRUE CACHE BOOL "")
|
||||
set(MACOS TRUE CACHE BOOL "")
|
||||
else()
|
||||
set(IOS TRUE CACHE BOOL "")
|
||||
endif()
|
||||
set(CMAKE_AR ar CACHE FILEPATH "" FORCE)
|
||||
set(CMAKE_RANLIB ranlib CACHE FILEPATH "" FORCE)
|
||||
set(CMAKE_STRIP strip CACHE FILEPATH "" FORCE)
|
||||
# Set the architectures for which to build.
|
||||
set(CMAKE_OSX_ARCHITECTURES ${ARCHS} CACHE INTERNAL "")
|
||||
# Change the type of target generated for try_compile() so it'll work when cross-compiling, weak compiler checks
|
||||
if(NOT ENABLE_STRICT_TRY_COMPILE_INT)
|
||||
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
|
||||
endif()
|
||||
# All iOS/Darwin specific settings - some may be redundant.
|
||||
set(CMAKE_MACOSX_BUNDLE YES)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
|
||||
set(CMAKE_SHARED_LIBRARY_PREFIX "lib")
|
||||
set(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib")
|
||||
set(CMAKE_SHARED_MODULE_PREFIX "lib")
|
||||
set(CMAKE_SHARED_MODULE_SUFFIX ".so")
|
||||
set(CMAKE_C_COMPILER_ABI ELF)
|
||||
set(CMAKE_CXX_COMPILER_ABI ELF)
|
||||
set(CMAKE_C_HAS_ISYSROOT 1)
|
||||
set(CMAKE_CXX_HAS_ISYSROOT 1)
|
||||
set(CMAKE_MODULE_EXISTS 1)
|
||||
set(CMAKE_DL_LIBS "")
|
||||
set(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ")
|
||||
set(CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version ")
|
||||
set(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
|
||||
set(CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}")
|
||||
|
||||
if(ARCHS MATCHES "((^|;|, )(arm64|arm64e|x86_64))+")
|
||||
set(CMAKE_C_SIZEOF_DATA_PTR 8)
|
||||
set(CMAKE_CXX_SIZEOF_DATA_PTR 8)
|
||||
if(ARCHS MATCHES "((^|;|, )(arm64|arm64e))+")
|
||||
set(CMAKE_SYSTEM_PROCESSOR "aarch64")
|
||||
else()
|
||||
set(CMAKE_SYSTEM_PROCESSOR "x86_64")
|
||||
endif()
|
||||
else()
|
||||
set(CMAKE_C_SIZEOF_DATA_PTR 4)
|
||||
set(CMAKE_CXX_SIZEOF_DATA_PTR 4)
|
||||
set(CMAKE_SYSTEM_PROCESSOR "arm")
|
||||
endif()
|
||||
|
||||
# Note that only Xcode 7+ supports the newer more specific:
|
||||
# -m${SDK_NAME}-version-min flags, older versions of Xcode use:
|
||||
# -m(ios/ios-simulator)-version-min instead.
|
||||
if(${CMAKE_VERSION} VERSION_LESS "3.11")
|
||||
if(PLATFORM_INT STREQUAL "OS" OR PLATFORM_INT STREQUAL "OS64")
|
||||
if(XCODE_VERSION_INT VERSION_LESS 7.0)
|
||||
set(SDK_NAME_VERSION_FLAGS "-mios-version-min=${DEPLOYMENT_TARGET}")
|
||||
else()
|
||||
# Xcode 7.0+ uses flags we can build directly from SDK_NAME.
|
||||
set(SDK_NAME_VERSION_FLAGS "-m${SDK_NAME}-version-min=${DEPLOYMENT_TARGET}")
|
||||
endif()
|
||||
elseif(PLATFORM_INT STREQUAL "TVOS")
|
||||
set(SDK_NAME_VERSION_FLAGS "-mtvos-version-min=${DEPLOYMENT_TARGET}")
|
||||
elseif(PLATFORM_INT STREQUAL "SIMULATOR_TVOS")
|
||||
set(SDK_NAME_VERSION_FLAGS "-mtvos-simulator-version-min=${DEPLOYMENT_TARGET}")
|
||||
elseif(PLATFORM_INT STREQUAL "WATCHOS")
|
||||
set(SDK_NAME_VERSION_FLAGS "-mwatchos-version-min=${DEPLOYMENT_TARGET}")
|
||||
elseif(PLATFORM_INT STREQUAL "SIMULATOR_WATCHOS")
|
||||
set(SDK_NAME_VERSION_FLAGS "-mwatchos-simulator-version-min=${DEPLOYMENT_TARGET}")
|
||||
elseif(PLATFORM_INT STREQUAL "MAC")
|
||||
set(SDK_NAME_VERSION_FLAGS "-mmacosx-version-min=${DEPLOYMENT_TARGET}")
|
||||
else()
|
||||
# SIMULATOR or SIMULATOR64 both use -mios-simulator-version-min.
|
||||
set(SDK_NAME_VERSION_FLAGS "-mios-simulator-version-min=${DEPLOYMENT_TARGET}")
|
||||
endif()
|
||||
elseif(NOT PLATFORM_INT MATCHES "^MAC_CATALYST")
|
||||
# Newer versions of CMake sets the version min flags correctly, skip this for Mac Catalyst targets
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET ${DEPLOYMENT_TARGET})
|
||||
endif()
|
||||
|
||||
if(DEFINED APPLE_TARGET_TRIPLE_INT)
|
||||
set(APPLE_TARGET_TRIPLE ${APPLE_TARGET_TRIPLE_INT} CACHE INTERNAL "")
|
||||
set(CMAKE_C_COMPILER_TARGET ${APPLE_TARGET_TRIPLE})
|
||||
set(CMAKE_CXX_COMPILER_TARGET ${APPLE_TARGET_TRIPLE})
|
||||
set(CMAKE_ASM_COMPILER_TARGET ${APPLE_TARGET_TRIPLE})
|
||||
endif()
|
||||
|
||||
if(PLATFORM_INT MATCHES "^MAC_CATALYST")
|
||||
set(C_TARGET_FLAGS
|
||||
"-isystem ${CMAKE_OSX_SYSROOT_INT}/System/iOSSupport/usr/include -iframework ${CMAKE_OSX_SYSROOT_INT}/System/iOSSupport/System/Library/Frameworks"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(ENABLE_BITCODE_INT)
|
||||
set(BITCODE "-fembed-bitcode")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_BITCODE_GENERATION_MODE "bitcode")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES")
|
||||
else()
|
||||
set(BITCODE "")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO")
|
||||
endif()
|
||||
|
||||
if(ENABLE_ARC_INT)
|
||||
set(FOBJC_ARC "-fobjc-arc")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC "YES")
|
||||
else()
|
||||
set(FOBJC_ARC "-fno-objc-arc")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC "NO")
|
||||
endif()
|
||||
|
||||
if(NOT ENABLE_VISIBILITY_INT)
|
||||
foreach(lang ${languages})
|
||||
set(CMAKE_${lang}_VISIBILITY_PRESET "hidden" CACHE INTERNAL "")
|
||||
endforeach()
|
||||
set(CMAKE_XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN "YES")
|
||||
set(VISIBILITY "-fvisibility=hidden -fvisibility-inlines-hidden")
|
||||
else()
|
||||
foreach(lang ${languages})
|
||||
set(CMAKE_${lang}_VISIBILITY_PRESET "default" CACHE INTERNAL "")
|
||||
endforeach()
|
||||
set(CMAKE_XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN "NO")
|
||||
set(VISIBILITY "-fvisibility=default")
|
||||
endif()
|
||||
|
||||
if(DEFINED APPLE_TARGET_TRIPLE)
|
||||
set(APPLE_TARGET_TRIPLE_FLAG "-target ${APPLE_TARGET_TRIPLE}")
|
||||
endif()
|
||||
|
||||
#Check if Xcode generator is used, since that will handle these flags automagically
|
||||
if(CMAKE_GENERATOR MATCHES "Xcode")
|
||||
message(STATUS "Not setting any manual command-line buildflags, since Xcode is selected as generator.")
|
||||
else()
|
||||
# Hidden visibility is required for C++ on iOS.
|
||||
set(CMAKE_C_FLAGS
|
||||
"${C_TARGET_FLAGS} ${APPLE_TARGET_TRIPLE_FLAG} ${SDK_NAME_VERSION_FLAGS} ${BITCODE} -fobjc-abi-version=2 ${FOBJC_ARC} ${CMAKE_C_FLAGS}"
|
||||
)
|
||||
set(CMAKE_CXX_FLAGS
|
||||
"${C_TARGET_FLAGS} ${APPLE_TARGET_TRIPLE_FLAG} ${SDK_NAME_VERSION_FLAGS} ${BITCODE} ${VISIBILITY} -fobjc-abi-version=2 ${FOBJC_ARC} ${CMAKE_CXX_FLAGS}"
|
||||
)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -O0 -g ${CMAKE_CXX_FLAGS_DEBUG}")
|
||||
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} -DNDEBUG -Os -ffast-math ${CMAKE_CXX_FLAGS_MINSIZEREL}")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS} -DNDEBUG -O2 -g -ffast-math ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -DNDEBUG -O3 -ffast-math ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
set(CMAKE_C_LINK_FLAGS "${C_TARGET_FLAGS} ${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")
|
||||
set(CMAKE_CXX_LINK_FLAGS
|
||||
"${C_TARGET_FLAGS} ${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}"
|
||||
)
|
||||
set(CMAKE_ASM_FLAGS
|
||||
"${CMAKE_C_FLAGS} -x assembler-with-cpp -arch ${CMAKE_OSX_ARCHITECTURES} ${APPLE_TARGET_TRIPLE_FLAG}"
|
||||
)
|
||||
endif()
|
||||
|
||||
## Print status messages to inform of the current state
|
||||
message(STATUS "Configuring ${SDK_NAME} build for platform: ${PLATFORM_INT}, architecture(s): ${ARCHS}")
|
||||
message(STATUS "Using SDK: ${CMAKE_OSX_SYSROOT_INT}")
|
||||
message(STATUS "Using C compiler: ${CMAKE_C_COMPILER}")
|
||||
message(STATUS "Using CXX compiler: ${CMAKE_CXX_COMPILER}")
|
||||
message(STATUS "Using libtool: ${BUILD_LIBTOOL}")
|
||||
message(STATUS "Using install name tool: ${CMAKE_INSTALL_NAME_TOOL}")
|
||||
if(DEFINED APPLE_TARGET_TRIPLE)
|
||||
message(STATUS "Autoconf target triple: ${APPLE_TARGET_TRIPLE}")
|
||||
endif()
|
||||
message(STATUS "Using minimum deployment version: ${DEPLOYMENT_TARGET}" " (SDK version: ${SDK_VERSION})")
|
||||
if(MODERN_CMAKE)
|
||||
message(STATUS "Merging integrated CMake 3.14+ iOS,tvOS,watchOS,macOS toolchain(s) with this toolchain!")
|
||||
endif()
|
||||
if(CMAKE_GENERATOR MATCHES "Xcode")
|
||||
message(STATUS "Using Xcode version: ${XCODE_VERSION_INT}")
|
||||
endif()
|
||||
message(STATUS "CMake version: ${CMAKE_VERSION}")
|
||||
if(DEFINED SDK_NAME_VERSION_FLAGS)
|
||||
message(STATUS "Using version flags: ${SDK_NAME_VERSION_FLAGS}")
|
||||
endif()
|
||||
message(STATUS "Using a data_ptr size of: ${CMAKE_CXX_SIZEOF_DATA_PTR}")
|
||||
if(ENABLE_BITCODE_INT)
|
||||
message(STATUS "Bitcode: Enabled")
|
||||
else()
|
||||
message(STATUS "Bitcode: Disabled")
|
||||
endif()
|
||||
|
||||
if(ENABLE_ARC_INT)
|
||||
message(STATUS "ARC: Enabled")
|
||||
else()
|
||||
message(STATUS "ARC: Disabled")
|
||||
endif()
|
||||
|
||||
if(ENABLE_VISIBILITY_INT)
|
||||
message(STATUS "Hiding symbols: Disabled")
|
||||
else()
|
||||
message(STATUS "Hiding symbols: Enabled")
|
||||
endif()
|
||||
|
||||
# Set global properties
|
||||
set_property(GLOBAL PROPERTY PLATFORM "${PLATFORM}")
|
||||
set_property(GLOBAL PROPERTY APPLE_TARGET_TRIPLE "${APPLE_TARGET_TRIPLE_INT}")
|
||||
set_property(GLOBAL PROPERTY SDK_VERSION "${SDK_VERSION}")
|
||||
set_property(GLOBAL PROPERTY XCODE_VERSION "${XCODE_VERSION_INT}")
|
||||
set_property(GLOBAL PROPERTY OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}")
|
||||
|
||||
# Export configurable variables for the try_compile() command.
|
||||
set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES
|
||||
PLATFORM
|
||||
XCODE_VERSION_INT
|
||||
SDK_VERSION
|
||||
DEPLOYMENT_TARGET
|
||||
CMAKE_DEVELOPER_ROOT
|
||||
CMAKE_OSX_SYSROOT_INT
|
||||
ENABLE_BITCODE
|
||||
ENABLE_ARC
|
||||
CMAKE_ASM_COMPILER
|
||||
CMAKE_C_COMPILER
|
||||
CMAKE_C_COMPILER_TARGET
|
||||
CMAKE_CXX_COMPILER
|
||||
CMAKE_CXX_COMPILER_TARGET
|
||||
BUILD_LIBTOOL
|
||||
CMAKE_INSTALL_NAME_TOOL
|
||||
CMAKE_C_FLAGS
|
||||
CMAKE_CXX_FLAGS
|
||||
CMAKE_CXX_FLAGS_DEBUG
|
||||
CMAKE_CXX_FLAGS_MINSIZEREL
|
||||
CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
||||
CMAKE_CXX_FLAGS_RELEASE
|
||||
CMAKE_C_LINK_FLAGS
|
||||
CMAKE_CXX_LINK_FLAGS
|
||||
CMAKE_ASM_FLAGS
|
||||
)
|
||||
|
||||
set(CMAKE_PLATFORM_HAS_INSTALLNAME 1)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "-rpath @executable_path/Frameworks -rpath @loader_path/Frameworks")
|
||||
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names")
|
||||
set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -Wl,-headerpad_max_install_names")
|
||||
set(CMAKE_SHARED_MODULE_LOADER_C_FLAG "-Wl,-bundle_loader,")
|
||||
set(CMAKE_SHARED_MODULE_LOADER_CXX_FLAG "-Wl,-bundle_loader,")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".tbd" ".dylib" ".so" ".a")
|
||||
set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name")
|
||||
|
||||
# Set the find root to the SDK developer roots.
|
||||
# Note: CMAKE_FIND_ROOT_PATH is only useful when cross-compiling. Thus, do not set on macOS builds.
|
||||
if(NOT PLATFORM_INT STREQUAL "MAC" AND NOT PLATFORM_INT STREQUAL "MAC_ARM64")
|
||||
list(APPEND CMAKE_FIND_ROOT_PATH "${CMAKE_OSX_SYSROOT_INT}" CACHE INTERNAL "")
|
||||
set(CMAKE_IGNORE_PATH "/System/Library/Frameworks;/usr/local/lib" CACHE INTERNAL "")
|
||||
endif()
|
||||
|
||||
# Default to searching for frameworks first.
|
||||
set(CMAKE_FIND_FRAMEWORK FIRST)
|
||||
|
||||
# Set up the default search directories for frameworks.
|
||||
if(PLATFORM_INT MATCHES "^MAC_CATALYST")
|
||||
set(CMAKE_FRAMEWORK_PATH
|
||||
${CMAKE_DEVELOPER_ROOT}/Library/PrivateFrameworks ${CMAKE_OSX_SYSROOT_INT}/System/Library/Frameworks
|
||||
${CMAKE_OSX_SYSROOT_INT}/System/iOSSupport/System/Library/Frameworks ${CMAKE_FRAMEWORK_PATH} CACHE INTERNAL ""
|
||||
)
|
||||
else()
|
||||
set(CMAKE_FRAMEWORK_PATH ${CMAKE_DEVELOPER_ROOT}/Library/PrivateFrameworks
|
||||
${CMAKE_OSX_SYSROOT_INT}/System/Library/Frameworks ${CMAKE_FRAMEWORK_PATH} CACHE INTERNAL ""
|
||||
)
|
||||
endif()
|
||||
|
||||
# By default, search both the specified iOS SDK and the remainder of the host filesystem.
|
||||
if(NOT CMAKE_FIND_ROOT_PATH_MODE_PROGRAM)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH CACHE INTERNAL "")
|
||||
endif()
|
||||
if(NOT CMAKE_FIND_ROOT_PATH_MODE_LIBRARY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH CACHE INTERNAL "")
|
||||
endif()
|
||||
if(NOT CMAKE_FIND_ROOT_PATH_MODE_INCLUDE)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH CACHE INTERNAL "")
|
||||
endif()
|
||||
if(NOT CMAKE_FIND_ROOT_PATH_MODE_PACKAGE)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH CACHE INTERNAL "")
|
||||
endif()
|
||||
|
||||
#
|
||||
# Some helper-macros below to simplify and beautify the CMakeFile
|
||||
#
|
||||
|
||||
# This little macro lets you set any Xcode specific property.
|
||||
macro(set_xcode_property TARGET XCODE_PROPERTY XCODE_VALUE XCODE_RELVERSION)
|
||||
set(XCODE_RELVERSION_I "${XCODE_RELVERSION}")
|
||||
if(XCODE_RELVERSION_I STREQUAL "All")
|
||||
set_property(TARGET ${TARGET} PROPERTY XCODE_ATTRIBUTE_${XCODE_PROPERTY} "${XCODE_VALUE}")
|
||||
else()
|
||||
set_property(
|
||||
TARGET ${TARGET} PROPERTY XCODE_ATTRIBUTE_${XCODE_PROPERTY}[variant=${XCODE_RELVERSION_I}] "${XCODE_VALUE}"
|
||||
)
|
||||
endif()
|
||||
endmacro(set_xcode_property)
|
||||
|
||||
# This macro lets you find executable programs on the host system.
|
||||
macro(find_host_package)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER)
|
||||
set(_TOOLCHAIN_IOS ${IOS})
|
||||
set(IOS FALSE)
|
||||
find_package(${ARGN})
|
||||
set(IOS ${_TOOLCHAIN_IOS})
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)
|
||||
endmacro(find_host_package)
|
||||
6
third_party/FreeRDP/cmake/oss-includes.h.in
vendored
Normal file
6
third_party/FreeRDP/cmake/oss-includes.h.in
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef OSS_INCLUDES_H_
|
||||
#define OSS_INCLUDES_H_
|
||||
|
||||
#include <@OSS_HDR_NAME@>
|
||||
|
||||
#endif /* OSS_INCLUDES_H_ */
|
||||
13
third_party/FreeRDP/cmake/pkg-config-install-prefix.cmake
vendored
Normal file
13
third_party/FreeRDP/cmake/pkg-config-install-prefix.cmake
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
option(PKG_CONFIG_RELOCATABLE "Generate relocatable pkg-config files" ON)
|
||||
if(PKG_CONFIG_RELOCATABLE)
|
||||
file(RELATIVE_PATH PKG_CONFIG_INSTALL_REL ${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig ${CMAKE_INSTALL_PREFIX})
|
||||
if(PKG_CONFIG_INSTALL_REL MATCHES "/$")
|
||||
string(LENGTH ${PKG_CONFIG_INSTALL_REL} PKG_CONFIG_INSTALL_REL_LEN)
|
||||
math(EXPR PKG_CONFIG_INSTALL_REL_LEN "${PKG_CONFIG_INSTALL_REL_LEN} - 1")
|
||||
string(SUBSTRING ${PKG_CONFIG_INSTALL_REL} 0 ${PKG_CONFIG_INSTALL_REL_LEN} PKG_CONFIG_INSTALL_REL)
|
||||
endif()
|
||||
set(PKG_CONFIG_INSTALL_PREFIX "\${pcfiledir}/${PKG_CONFIG_INSTALL_REL}")
|
||||
else()
|
||||
set(PKG_CONFIG_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
|
||||
endif()
|
||||
set(PKG_CONFIG_PC_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
||||
14
third_party/FreeRDP/cmake/today.cmake
vendored
Normal file
14
third_party/FreeRDP/cmake/today.cmake
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
# This script returns the current date in ISO format
|
||||
#
|
||||
# YYYY-MM-DD
|
||||
#
|
||||
macro(TODAY RESULT)
|
||||
if(DEFINED ENV{SOURCE_DATE_EPOCH} AND NOT WIN32)
|
||||
execute_process(
|
||||
COMMAND "date" "-u" "-d" "@$ENV{SOURCE_DATE_EPOCH}" "+%Y-%m-%d" OUTPUT_VARIABLE ${RESULT}
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
else()
|
||||
string(TIMESTAMP ${RESULT} "%Y-%m-%d" UTC)
|
||||
endif()
|
||||
endmacro(TODAY)
|
||||
Reference in New Issue
Block a user