summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:25:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:25:11 +0000
commit941f9937e0744d18de4cc0afa71e0caa925d82ac (patch)
tree67872b86dbf72d73e91188bf8de12594668fe4aa /cmake
parentAdding upstream version 3.3.0+dfsg1. (diff)
downloadfreerdp3-941f9937e0744d18de4cc0afa71e0caa925d82ac.tar.xz
freerdp3-941f9937e0744d18de4cc0afa71e0caa925d82ac.zip
Adding upstream version 3.5.0+dfsg1.upstream/3.5.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/AddFuzzerTest.cmake15
-rw-r--r--cmake/AddTargetWithResourceFile.cmake119
-rw-r--r--cmake/CommonConfigOptions.cmake3
-rw-r--r--cmake/ConfigOptions.cmake2
-rw-r--r--cmake/ConfigureRPATH.cmake23
-rw-r--r--cmake/DetectBSD.cmake18
-rw-r--r--cmake/FindIPP.cmake397
-rw-r--r--cmake/FindOSS.cmake39
-rw-r--r--cmake/InstallFreeRDPMan.cmake33
-rw-r--r--cmake/PlatformDefaults.cmake103
-rw-r--r--cmake/oss-includes.h.in6
11 files changed, 307 insertions, 451 deletions
diff --git a/cmake/AddFuzzerTest.cmake b/cmake/AddFuzzerTest.cmake
new file mode 100644
index 0000000..e16aa1b
--- /dev/null
+++ b/cmake/AddFuzzerTest.cmake
@@ -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()
diff --git a/cmake/AddTargetWithResourceFile.cmake b/cmake/AddTargetWithResourceFile.cmake
new file mode 100644
index 0000000..355902e
--- /dev/null
+++ b/cmake/AddTargetWithResourceFile.cmake
@@ -0,0 +1,119 @@
+set(add_resource_macro_internal_dir ${CMAKE_CURRENT_LIST_DIR} CACHE INTERNAL "")
+
+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)
+ 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)
+ 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()
+
+ 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)
+ set_target_properties(
+ ${target}
+ PROPERTIES
+ VERSION ${version}
+ SOVERSION ${RC_VERSION_MAJOR}
+ )
+ else()
+ set_target_properties(${target} PROPERTIES PREFIX "")
+ endif()
+
+ set_target_properties(
+ ${target}
+ PROPERTIES
+ OUTPUT_NAME ${OUTPUT_FILENAME}
+ )
+ set (OUTPUT_FILENAME "${CMAKE_SHARED_LIBRARY_PREFIX}${OUTPUT_FILENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
+ 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()
diff --git a/cmake/CommonConfigOptions.cmake b/cmake/CommonConfigOptions.cmake
index 8d7f485..66924e8 100644
--- a/cmake/CommonConfigOptions.cmake
+++ b/cmake/CommonConfigOptions.cmake
@@ -28,9 +28,10 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "project default")
endif()
+include(PlatformDefaults)
include(PreventInSourceBuilds)
include(GNUInstallDirsWrapper)
include(MSVCRuntime)
include(ConfigureRPATH)
include(ClangTidy)
-
+include(AddTargetWithResourceFile)
diff --git a/cmake/ConfigOptions.cmake b/cmake/ConfigOptions.cmake
index ce451c6..7f3ffb8 100644
--- a/cmake/ConfigOptions.cmake
+++ b/cmake/ConfigOptions.cmake
@@ -24,7 +24,6 @@ option(WITH_GPROF "Compile with GProf profiler." OFF)
option(WITH_SSE2 "Enable SSE2 optimization." OFF)
option(WITH_NEON "Enable NEON optimization." OFF)
-option(WITH_IPP "Use Intel Performance Primitives." OFF)
option(WITH_JPEG "Use JPEG decoding." OFF)
@@ -80,6 +79,7 @@ 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)
diff --git a/cmake/ConfigureRPATH.cmake b/cmake/ConfigureRPATH.cmake
index 9af2af8..284511f 100644
--- a/cmake/ConfigureRPATH.cmake
+++ b/cmake/ConfigureRPATH.cmake
@@ -1,18 +1,25 @@
# RPATH configuration
-set(CMAKE_SKIP_BUILD_RPATH FALSE)
-set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
-set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
+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(CMAKE_INSTALL_RPATH "@loader_path/${FRAMEWORK_PATH}")
-else (APPLE)
+ set(CFG_INSTALL_RPATH "@loader_path/${FRAMEWORK_PATH}")
+elseif(NOT WIN32)
if (NOT FREEBSD)
- set(CMAKE_INSTALL_RPATH "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:\$ORIGIN/..")
option(WITH_ADD_PLUGIN_TO_RPATH "Add extension and plugin path to RPATH" OFF)
if (WITH_ADD_PLUGIN_TO_RPATH)
- set(CMAKE_INSTALL_RPATH "\$ORIGIN/../${FREERDP_EXTENSION_REL_PATH}:\$ORIGIN/../${FREERDP_PLUGIN_PATH}:${CMAKE_INSTALL_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}")
diff --git a/cmake/DetectBSD.cmake b/cmake/DetectBSD.cmake
deleted file mode 100644
index 5c5b3b0..0000000
--- a/cmake/DetectBSD.cmake
+++ /dev/null
@@ -1,18 +0,0 @@
-# BSD
-if(${CMAKE_SYSTEM_NAME} MATCHES "BSD")
- set(BSD TRUE CACHE INTERNAL "BSD detection")
- if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
- set(FREEBSD TRUE CACHE INTERNAL "BSD detection")
- endif()
- if(${CMAKE_SYSTEM_NAME} MATCHES "kFreeBSD")
- set(KFREEBSD TRUE CACHE INTERNAL "BSD detection")
- endif()
- if(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
- set(OPENBSD TRUE CACHE INTERNAL "BSD detection")
- endif()
-endif()
-
-if(${CMAKE_SYSTEM_NAME} MATCHES "DragonFly")
- set(BSD TRUE CACHE INTERNAL "BSD detection")
- set(FREEBSD TRUE CACHE INTERNAL "BSD detection")
-endif()
diff --git a/cmake/FindIPP.cmake b/cmake/FindIPP.cmake
deleted file mode 100644
index 1e06762..0000000
--- a/cmake/FindIPP.cmake
+++ /dev/null
@@ -1,397 +0,0 @@
-# This cmake script is taken from the OpenCV project (BSD license)
-
-#
-# The script to detect Intel(R) Integrated Performance Primitives (IPP)
-# installation/package
-#
-# This will try to find Intel IPP libraries, and include path by automatic
-# search through typical install locations and if failed it will
-# examine IPPROOT environment variable.
-# Note, IPPROOT is not set by IPP installer, it should be set manually.
-#
-# On return this will define:
-#
-# IPP_FOUND - True if Intel IPP found
-# IPP_ROOT_DIR - root of IPP installation
-# IPP_INCLUDE_DIRS - IPP include folder
-# IPP_LIBRARY_DIRS - IPP libraries folder
-# IPP_LIBRARIES - IPP libraries names that are used by OpenCV
-# IPP_LATEST_VERSION_STR - string with the newest detected IPP version
-# IPP_LATEST_VERSION_MAJOR - numbers of IPP version (MAJOR.MINOR.BUILD)
-# IPP_LATEST_VERSION_MINOR
-# IPP_LATEST_VERSION_BUILD
-#
-# Created: 30 Dec 2010 by Vladimir Dudnik (vladimir.dudnik@intel.com)
-#
-
-set(IPP_FOUND)
-set(IPP_VERSION_STR "5.3.0.0") # will not detect earlier versions
-set(IPP_VERSION_MAJOR 0)
-set(IPP_VERSION_MINOR 0)
-set(IPP_VERSION_BUILD 0)
-set(IPP_ROOT_DIR)
-set(IPP_INCLUDE_DIRS)
-set(IPP_LIBRARY_DIRS)
-set(IPP_LIBRARIES)
-set(IPP_LIB_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX})
-set(IPP_LIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
-set(IPP_PREFIX "ipp")
-set(IPP_SUFFIX "_l")
-set(IPPCORE "core") # core functionality
-set(IPPS "s") # signal processing
-set(IPPI "i") # image processing
-set(IPPCC "cc") # color conversion
-set(IPPCV "cv") # computer vision
-set(IPPVM "vm") # vector math
-
-
-set(IPP_X64 0)
-if (CMAKE_SIZEOF_VOID_P EQUAL 8)
- set(IPP_X64 1)
-endif()
-if (CMAKE_CL_64)
- set(IPP_X64 1)
-endif()
-
-# ------------------------------------------------------------------------
-# This function detect IPP version by analyzing ippversion.h file
-# Note, ippversion.h file was inroduced since IPP 5.3
-# ------------------------------------------------------------------------
-function(get_ipp_version _ROOT_DIR)
- set(_VERSION_STR)
- set(_MAJOR)
- set(_MINOR)
- set(_BUILD)
-
- # read IPP version info from file
- file(STRINGS ${_ROOT_DIR}/include/ippversion.h STR1 REGEX "IPP_VERSION_MAJOR")
- file(STRINGS ${_ROOT_DIR}/include/ippversion.h STR2 REGEX "IPP_VERSION_MINOR")
- file(STRINGS ${_ROOT_DIR}/include/ippversion.h STR3 REGEX "IPP_VERSION_BUILD")
-
- if(NOT STR3)
- file(STRINGS ${_ROOT_DIR}/include/ippversion.h STR3 REGEX "IPP_VERSION_UPDATE")
- endif()
-
- file(STRINGS ${_ROOT_DIR}/include/ippversion.h STR4 REGEX "IPP_VERSION_STR")
-
- # extract info and assign to variables
- string(REGEX MATCHALL "[0-9]+" _MAJOR ${STR1})
- string(REGEX MATCHALL "[0-9]+" _MINOR ${STR2})
- string(REGEX MATCHALL "[0-9]+" _BUILD ${STR3})
- string(REGEX MATCHALL "[0-9]+[.]+[0-9]+[^\"]+|[0-9]+[.]+[0-9]+" _VERSION_STR ${STR4})
-
- # export info to parent scope
- set(IPP_VERSION_STR ${_VERSION_STR} PARENT_SCOPE)
- set(IPP_VERSION_MAJOR ${_MAJOR} PARENT_SCOPE)
- set(IPP_VERSION_MINOR ${_MINOR} PARENT_SCOPE)
- set(IPP_VERSION_BUILD ${_BUILD} PARENT_SCOPE)
-
- message(STATUS "found IPP: ${_MAJOR}.${_MINOR}.${_BUILD} [${_VERSION_STR}]")
- message(STATUS "at: ${_ROOT_DIR}")
-
- return()
-
-endfunction()
-
-
-# ------------------------------------------------------------------------
-# This is auxiliary function called from set_ipp_variables()
-# to set IPP_LIBRARIES variable in IPP 6.x style (IPP 5.3 should also work)
-# ------------------------------------------------------------------------
-function(set_ipp_old_libraries)
- set(IPP_PREFIX "ipp")
- set(IPP_SUFFIX) # old style static core libs suffix
- set(IPP_ARCH) # architecture suffix
- set(IPP_DISP "emerged") # old style dipatcher and cpu-specific
- set(IPP_MRGD "merged") # static libraries
- set(IPPCORE "core") # core functionality
- set(IPPSP "s") # signal processing
- set(IPPIP "i") # image processing
- set(IPPCC "cc") # color conversion
- set(IPPCV "cv") # computer vision
- set(IPPVM "vm") # vector math
-
- if (IPP_X64)
- set(IPP_ARCH "em64t")
- endif()
-
- if(WIN32)
- set(IPP_SUFFIX "l")
- endif()
-
- set(IPP_LIBRARIES
- ${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPVM}${IPP_MRGD}${IPP_ARCH}${IPP_LIB_SUFFIX}
- ${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPVM}${IPP_DISP}${IPP_ARCH}${IPP_LIB_SUFFIX}
- ${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCC}${IPP_MRGD}${IPP_ARCH}${IPP_LIB_SUFFIX}
- ${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCC}${IPP_DISP}${IPP_ARCH}${IPP_LIB_SUFFIX}
- ${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCV}${IPP_MRGD}${IPP_ARCH}${IPP_LIB_SUFFIX}
- ${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCV}${IPP_DISP}${IPP_ARCH}${IPP_LIB_SUFFIX}
- ${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPIP}${IPP_MRGD}${IPP_ARCH}${IPP_LIB_SUFFIX}
- ${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPIP}${IPP_DISP}${IPP_ARCH}${IPP_LIB_SUFFIX}
- ${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPSP}${IPP_MRGD}${IPP_ARCH}${IPP_LIB_SUFFIX}
- ${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPSP}${IPP_DISP}${IPP_ARCH}${IPP_LIB_SUFFIX}
- ${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCORE}${IPP_ARCH}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
- PARENT_SCOPE)
-
- return()
-
-endfunction()
-
-
-# ------------------------------------------------------------------------
-# This is auxiliary function called from set_ipp_variables()
-# to set IPP_LIBRARIES variable in IPP 7.x style
-# ------------------------------------------------------------------------
-function(set_ipp_new_libraries)
- set(IPP_PREFIX "ipp")
- set(IPP_SUFFIX "_l") # static not threaded libs suffix
- set(IPP_THRD "_t") # static threaded libs suffix
- set(IPPCORE "core") # core functionality
- set(IPPSP "s") # signal processing
- set(IPPIP "i") # image processing
- set(IPPCC "cc") # color conversion
- set(IPPCV "cv") # computer vision
- set(IPPVM "vm") # vector math
-
- set(IPP_LIBRARIES
- ${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPVM}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
- ${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCC}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
- ${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCV}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
- ${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPI}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
- ${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPS}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
- ${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCORE}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
- PARENT_SCOPE)
-
- return()
-
-endfunction()
-
-
-# ------------------------------------------------------------------------
-# This function will set
-# IPP_INCLUDE_DIRS, IPP_LIBRARY_DIRS and IPP_LIBRARIES variables depending
-# on IPP version parameter.
-# Since IPP 7.0 version library names and install folder structure
-# was changed
-# ------------------------------------------------------------------------
-function(set_ipp_variables _LATEST_VERSION)
- if(${_LATEST_VERSION} VERSION_LESS "7.0")
-# message(STATUS "old")
-
- # set INCLUDE and LIB folders
- set(IPP_INCLUDE_DIRS ${IPP_ROOT_DIR}/include PARENT_SCOPE)
- set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib PARENT_SCOPE)
-
- if (IPP_X64)
- if(NOT EXISTS ${IPP_ROOT_DIR}/../em64t)
- message(SEND_ERROR "IPP EM64T libraries not found")
- endif()
- else()
- if(NOT EXISTS ${IPP_ROOT_DIR}/../ia32)
- message(SEND_ERROR "IPP IA32 libraries not found")
- endif()
- endif()
-
- # set IPP_LIBRARIES variable (6.x lib names)
- set_ipp_old_libraries()
- set(IPP_LIBRARIES ${IPP_LIBRARIES} PARENT_SCOPE)
- message(STATUS "IPP libs: ${IPP_LIBRARIES}")
-
- else()
-# message(STATUS "new")
-
- # set INCLUDE and LIB folders
- set(IPP_INCLUDE_DIRS ${IPP_ROOT_DIR}/include PARENT_SCOPE)
-
- if(APPLE)
- set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib PARENT_SCOPE)
- else()
- if(IPP_X64)
- if(NOT EXISTS ${IPP_ROOT_DIR}/lib/intel64)
- message(SEND_ERROR "IPP EM64T libraries not found")
- endif()
- set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib/intel64 PARENT_SCOPE)
- else()
- if(NOT EXISTS ${IPP_ROOT_DIR}/lib/ia32)
- message(SEND_ERROR "IPP IA32 libraries not found")
- endif()
- set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib/ia32 PARENT_SCOPE)
- endif()
- endif()
-
- # set IPP_LIBRARIES variable (7.x lib names)
- set_ipp_new_libraries()
- set(IPP_LIBRARIES ${IPP_LIBRARIES} PARENT_SCOPE)
- message(STATUS "IPP libs: ${IPP_LIBRARIES}")
-
- endif()
-
- return()
-
-endfunction()
-
-
-# ------------------------------------------------------------------------
-# This section will look for IPP through IPPROOT env variable
-# Note, IPPROOT is not set by IPP installer, you may need to set it manually
-# ------------------------------------------------------------------------
-find_path(
- IPP_H_PATH
- NAMES ippversion.h
- PATHS $ENV{IPPROOT}
- PATH_SUFFIXES include
- DOC "The path to Intel(R) IPP header files"
- NO_DEFAULT_PATH
- NO_CMAKE_PATH)
-
-if(IPP_H_PATH)
- set(IPP_FOUND 1)
-
- # traverse up to IPPROOT level
- get_filename_component(IPP_ROOT_DIR ${IPP_H_PATH} PATH)
-
- # extract IPP version info
- get_ipp_version(${IPP_ROOT_DIR})
-
- # keep info in the same vars for auto search and search by IPPROOT
- set(IPP_LATEST_VERSION_STR ${IPP_VERSION_STR})
- set(IPP_LATEST_VERSION_MAJOR ${IPP_VERSION_MAJOR})
- set(IPP_LATEST_VERSION_MINOR ${IPP_VERSION_MINOR})
- set(IPP_LATEST_VERSION_BUILD ${IPP_VERSION_BUILD})
-
- # set IPP INCLUDE, LIB dirs and library names
- set_ipp_variables(${IPP_LATEST_VERSION_STR})
-endif()
-
-
-if(NOT IPP_FOUND)
- # reset var from previous search
- set(IPP_H_PATH)
-
-
- # ------------------------------------------------------------------------
- # This section will look for IPP through system program folders
- # Note, if several IPP installations found the newest version will be
- # selected
- # ------------------------------------------------------------------------
- foreach(curdir ${CMAKE_SYSTEM_PREFIX_PATH} /opt)
- set(curdir ${curdir}/intel)
- file(TO_CMAKE_PATH ${curdir} CURDIR)
-
- if(EXISTS ${curdir})
- file(GLOB_RECURSE IPP_H_DIR ${curdir}/ippversion.h)
-
- if(IPP_H_DIR)
- set(IPP_FOUND 1)
- endif()
-
- # init IPP_LATEST_VERSION version with oldest detectable version (5.3.0.0)
- # IPP prior 5.3 did not have ippversion.h file
- set(IPP_LATEST_VERSION_STR ${IPP_VERSION_STR})
-
- # look through all dirs where ippversion.h was found
- foreach(item ${IPP_H_DIR})
-
- # traverse up to IPPROOT level
- get_filename_component(_FILE_PATH ${item} PATH)
- get_filename_component(_ROOT_DIR ${_FILE_PATH} PATH)
-
- # extract IPP version info
- get_ipp_version(${_ROOT_DIR})
-
- # remember the latest version (if many found)
- if(${IPP_LATEST_VERSION_STR} VERSION_LESS ${IPP_VERSION_STR})
- set(IPP_LATEST_VERSION_STR ${IPP_VERSION_STR})
- set(IPP_LATEST_VERSION_MAJOR ${IPP_VERSION_MAJOR})
- set(IPP_LATEST_VERSION_MINOR ${IPP_VERSION_MINOR})
- set(IPP_LATEST_VERSION_BUILD ${IPP_VERSION_BUILD})
- set(IPP_ROOT_DIR ${_ROOT_DIR})
- endif()
- endforeach()
- endif()
- endforeach()
-endif()
-
-if(IPP_FOUND)
- # set IPP INCLUDE, LIB dirs and library names
- set_ipp_variables(${IPP_LATEST_VERSION_STR})
-
- # set CACHE variable IPP_H_PATH,
- # path to IPP header files for the latest version
- find_path(
- IPP_H_PATH
- NAMES ippversion.h
- PATHS ${IPP_ROOT_DIR}
- PATH_SUFFIXES include
- DOC "The path to Intel(R) IPP header files"
- NO_DEFAULT_PATH
- NO_CMAKE_PATH)
-endif()
-
-if(WIN32 AND MINGW AND NOT IPP_LATEST_VERSION_MAJOR LESS 7)
- # Since IPP built with Microsoft compiler and /GS option
- # ======================================================
- # From Windows SDK 7.1
- # (usually in "C:\Program Files\Microsoft Visual Studio 10.0\VC\lib"),
- # to avoid undefined reference to __security_cookie and _chkstk:
- set(MSV_RUNTMCHK "RunTmChk")
- set(IPP_LIBRARIES ${IPP_LIBRARIES} ${MSV_RUNTMCHK}${IPP_LIB_SUFFIX})
-
- # To avoid undefined reference to _alldiv and _chkstk
- # ===================================================
- # NB: it may require a recompilation of w32api (after having modified
- # the file ntdll.def) to export the required functions
- # See http://code.opencv.org/issues/1906 for additional details
- set(MSV_NTDLL "ntdll")
- set(IPP_LIBRARIES ${IPP_LIBRARIES} ${MSV_NTDLL}${IPP_LIB_SUFFIX})
-endif()
-
-# ------------------------------------------------------------------------
-# This section will look for the IPP "compiler" dependent library
-# libiomp5.
-# ------------------------------------------------------------------------
-foreach(curdir ${CMAKE_SYSTEM_PREFIX_PATH} /opt)
- set(curdir ${curdir}/intel)
-
- if(EXISTS ${curdir})
- file(GLOB_RECURSE liblist FOLLOW_SYMLINKS ${curdir}/libiomp5.*)
- foreach(lib ${liblist})
- get_filename_component(libdir ${lib} REALPATH)
- get_filename_component(libdir ${libdir} PATH)
-
- if(${IPP_VERSION_MAJOR} VERSION_LESS "7")
- set(IPP_COMPILER_LIBRARY_DIRS ${libdir})
- set(IPP_COMPILER_LIBRARIES iomp5)
- else()
- if(APPLE)
- set(IPP_COMPILER_LIBRARY_DIRS ${libdir})
- set(IPP_COMPILER_LIBRARIES iomp5)
- else()
- if(IPP_X64)
- if(("${libdir}" MATCHES "intel64"))
- set(IPP_COMPILER_LIBRARY_DIRS ${libdir})
- set(IPP_COMPILER_LIBRARIES iomp5)
- endif()
- else()
- set(IPP_COMPILER_LIBRARY_DIRS ${libdir})
- set(IPP_COMPILER_LIBRARIES iomp5)
- endif()
- endif()
- endif()
- endforeach(lib)
- endif()
-endforeach(curdir)
-
-# ------------------------------------------------------------------------
-# Build fullpath library list.
-# ------------------------------------------------------------------------
-find_library(LIB_IPPI ippi PATHS ${IPP_LIBRARY_DIRS})
-set(IPP_LIBRARY_LIST ${IPP_LIBRARY_LIST} ${LIB_IPPI})
-find_library(LIB_IPPS ipps PATHS ${IPP_LIBRARY_DIRS})
-set(IPP_LIBRARY_LIST ${IPP_LIBRARY_LIST} ${LIB_IPPS})
-find_library(LIB_IPPCORE ippcore PATHS ${IPP_LIBRARY_DIRS})
-set(IPP_LIBRARY_LIST ${IPP_LIBRARY_LIST} ${LIB_IPPCORE})
-find_library(LIB_IOMP5 iomp5 PATHS ${IPP_COMPILER_LIBRARY_DIRS})
-set(IPP_LIBRARY_LIST ${IPP_LIBRARY_LIST} ${LIB_IOMP5})
-
-
diff --git a/cmake/FindOSS.cmake b/cmake/FindOSS.cmake
index 811e052..a750db6 100644
--- a/cmake/FindOSS.cmake
+++ b/cmake/FindOSS.cmake
@@ -4,29 +4,27 @@
IF(UNIX)
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
- SET(OSS_HDR_NAME "linux/soundcard.h")
- ELSE(CMAKE_SYSTEM_NAME MATCHES "Linux")
- IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
- SET(OSS_HDR_NAME "sys/soundcard.h")
- ELSE(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
- IF(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
- SET(OSS_HDR_NAME "soundcard.h")
- ELSE(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
- SET(OSS_HDR_NAME "machine/soundcard.h")
- ENDIF(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
- ENDIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
- ENDIF(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)
-FIND_PATH(OSS_INCLUDE_DIR "${OSS_HDR_NAME}"
- "/usr/include" "/usr/local/include"
+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_DIR)
- SET(OSS_FOUND TRUE)
-ELSE(OSS_INCLUDE_DIR)
- SET(OSS_FOUND)
-ENDIF(OSS_INCLUDE_DIR)
+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")
@@ -40,5 +38,6 @@ ENDIF(OSS_FOUND)
MARK_AS_ADVANCED (
OSS_FOUND
- OSS_INCLUDE_DIR
+ OSS_HDR_NAME
+ OSS_INCLUDE_DIRS
)
diff --git a/cmake/InstallFreeRDPMan.cmake b/cmake/InstallFreeRDPMan.cmake
index ba0d8a8..c333f64 100644
--- a/cmake/InstallFreeRDPMan.cmake
+++ b/cmake/InstallFreeRDPMan.cmake
@@ -7,11 +7,27 @@ function(install_freerdp_man manpage section)
endif()
endfunction()
-function(generate_and_install_freerdp_man_from_xml template manpage dependencies)
+function(generate_and_install_freerdp_man_from_template name_base section api)
if(WITH_MANPAGES)
- find_program(XSLTPROC_EXECUTABLE NAMES xsltproc REQUIRED)
- if (NOT DOCBOOKXSL_FOUND)
- message(FATAL_ERROR "docbook xsl not found but required for manpage generation")
+ 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()
+ configure_file(${name_base}.${section}.in ${manpage})
+ install_freerdp_man(${manpage} ${section})
+ endif()
+endfunction()
+
+function(generate_and_install_freerdp_man_from_xml name_base section api dependencies)
+ if(WITH_MANPAGES)
+ set(template "${name_base}.${section}")
+ if (WITH_BINARY_VERSIONING)
+ set(MANPAGE_NAME "${name_base}${api}")
+ set(manpage "${name_base}${api}.${section}")
+ else()
+ set(MANPAGE_NAME "${name_base}")
+ set(manpage "${name_base}.${section}")
endif()
# We need the variable ${MAN_TODAY} to contain the current date in ISO
@@ -34,8 +50,13 @@ function(generate_and_install_freerdp_man_from_xml template manpage dependencies
endif()
endforeach()
+ find_program(XSLTPROC_EXECUTABLE NAMES xsltproc REQUIRED)
+ if (NOT DOCBOOKXSL_FOUND)
+ message(FATAL_ERROR "docbook xsl not found but required for manpage generation")
+ endif()
+
add_custom_command(
- OUTPUT ${manpage}
+ OUTPUT "${manpage}"
COMMAND ${CMAKE_BINARY_DIR}/client/common/man/generate_argument_docbook
COMMAND ${XSLTPROC_EXECUTABLE} --path "${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}" ${DOCBOOKXSL_DIR}/manpages/docbook.xsl ${manpage}.xml
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
@@ -50,6 +71,6 @@ function(generate_and_install_freerdp_man_from_xml template manpage dependencies
DEPENDS
${manpage}
)
- install_freerdp_man(${CMAKE_CURRENT_BINARY_DIR}/${manpage} 1)
+ install_freerdp_man(${CMAKE_CURRENT_BINARY_DIR}/${manpage} ${section})
endif()
endfunction()
diff --git a/cmake/PlatformDefaults.cmake b/cmake/PlatformDefaults.cmake
new file mode 100644
index 0000000..30c8a92
--- /dev/null
+++ b/cmake/PlatformDefaults.cmake
@@ -0,0 +1,103 @@
+# This option allows deactivating FreeRDP supplied platform defauts 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_definitions("-D_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_definitions("-D_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_definitions("-D_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 reenable the BSD calls...
+ add_definitions("-D__BSD_VISIBLE")
+
+ # There are some symbols only visible for XOpen standard
+ add_definitions("-D_XOPEN_SOURCE=700")
+ add_definitions("-D_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_definitions("-D_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_definitions("-D_POSIX_C_SOURCE=200809L")
+
+ # as _POSIX_C_SOURCE sets a fully POSIX confirmant environment reenable
+ # MacOS API visibility by defining the following feature test macro
+ add_definitions("-D_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_definitions(-DKFREEBSD)
+ add_definitions("-D_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_definitions("-D_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 reenable the BSD calls...
+ add_definitions("-D__BSD_VISIBLE")
+
+ # There are some symbols only visible for XOpen standard
+ add_definitions("-D_XOPEN_SOURCE=700")
+ add_definitions("-D_FILE_OFFSET_BITS=64")
+ set(WINPR_TIMEZONE_FILE "/var/db/zoneinfo")
+ endif()
+
+ if(BSD)
+ if(IS_DIRECTORY /usr/local/include)
+ include_directories(/usr/local/include)
+ link_directories(/usr/local/lib)
+ endif()
+ if(OPENBSD)
+ if(IS_DIRECTORY /usr/X11R6/include)
+ include_directories(/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_definitions("-DWINPR_TIMEZONE_FILE=\"${WINPR_TIMEZONE_FILE}\"")
+endif()
diff --git a/cmake/oss-includes.h.in b/cmake/oss-includes.h.in
new file mode 100644
index 0000000..f3fb673
--- /dev/null
+++ b/cmake/oss-includes.h.in
@@ -0,0 +1,6 @@
+#ifndef OSS_INCLUDES_H_
+#define OSS_INCLUDES_H_
+
+#include <@OSS_HDR_NAME@>
+
+#endif /* OSS_INCLUDES_H_ */