2012-10-09 07:02:04 +04:00
|
|
|
# FreeRDP: A Remote Desktop Protocol Implementation
|
2011-07-02 21:58:55 +04:00
|
|
|
# FreeRDP cmake build script
|
|
|
|
#
|
|
|
|
# Copyright 2011 O.S. Systems Software Ltda.
|
|
|
|
# Copyright 2011 Otavio Salvador <otavio@ossystems.com.br>
|
|
|
|
# Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
2012-06-13 23:45:58 +04:00
|
|
|
# Copyright 2012 HP Development Company, LLC
|
2011-07-02 21:58:55 +04:00
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2012-10-04 17:42:23 +04:00
|
|
|
cmake_minimum_required(VERSION 2.8)
|
|
|
|
|
2014-04-21 22:42:24 +04:00
|
|
|
project(FreeRDP C CXX)
|
2012-10-04 17:42:23 +04:00
|
|
|
|
2013-09-10 06:25:47 +04:00
|
|
|
if(NOT DEFINED VENDOR)
|
|
|
|
set(VENDOR "FreeRDP" CACHE STRING "FreeRDP package vendor")
|
|
|
|
endif()
|
|
|
|
|
2015-06-02 10:07:17 +03:00
|
|
|
if(NOT DEFINED PRODUCT)
|
|
|
|
set(PRODUCT "FreeRDP" CACHE STRING "FreeRDP package name")
|
|
|
|
endif()
|
|
|
|
|
2014-05-09 20:25:05 +04:00
|
|
|
if(NOT DEFINED FREERDP_VENDOR)
|
|
|
|
set(FREERDP_VENDOR 1)
|
|
|
|
endif()
|
|
|
|
|
2011-07-01 04:31:07 +04:00
|
|
|
set(CMAKE_COLOR_MAKEFILE ON)
|
|
|
|
|
2013-09-04 05:48:26 +04:00
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
|
2012-11-23 18:12:52 +04:00
|
|
|
# Include our extra modules
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/)
|
|
|
|
|
2016-03-29 23:03:15 +03:00
|
|
|
if((CMAKE_SYSTEM_NAME MATCHES "WindowsStore") AND (CMAKE_SYSTEM_VERSION MATCHES "10.0"))
|
|
|
|
set(UWP 1)
|
|
|
|
add_definitions("-D_UWP")
|
|
|
|
set(CMAKE_WINDOWS_VERSION "WIN10")
|
|
|
|
endif()
|
|
|
|
|
2012-11-23 18:12:52 +04:00
|
|
|
# Check for cmake compatibility (enable/disable features)
|
|
|
|
include(CheckCmakeCompat)
|
|
|
|
|
2011-07-04 07:40:26 +04:00
|
|
|
# Include cmake modules
|
|
|
|
include(CheckIncludeFiles)
|
|
|
|
include(CheckLibraryExists)
|
2015-01-29 07:50:12 +03:00
|
|
|
include(CheckSymbolExists)
|
2012-02-16 01:28:47 +04:00
|
|
|
include(CheckStructHasMember)
|
2011-08-15 14:21:58 +04:00
|
|
|
include(FindPkgConfig)
|
2011-07-04 07:40:26 +04:00
|
|
|
include(TestBigEndian)
|
|
|
|
|
2012-11-03 03:27:01 +04:00
|
|
|
include(FindFeature)
|
2011-07-02 23:44:40 +04:00
|
|
|
include(AutoVersioning)
|
2011-07-04 13:01:06 +04:00
|
|
|
include(ConfigOptions)
|
2012-10-13 23:20:39 +04:00
|
|
|
include(ComplexLibrary)
|
2012-11-03 03:27:01 +04:00
|
|
|
include(FeatureSummary)
|
2011-09-20 07:02:07 +04:00
|
|
|
include(CheckCCompilerFlag)
|
2014-04-30 14:11:28 +04:00
|
|
|
include(CheckCXXCompilerFlag)
|
2011-12-06 09:02:07 +04:00
|
|
|
include(GNUInstallDirsWrapper)
|
2013-10-29 06:09:31 +04:00
|
|
|
include(CMakePackageConfigHelpers)
|
2017-01-16 13:34:32 +03:00
|
|
|
include(InstallFreeRDPMan)
|
2011-07-02 23:44:40 +04:00
|
|
|
|
2012-01-14 22:33:04 +04:00
|
|
|
# Soname versioning
|
2014-10-09 18:16:47 +04:00
|
|
|
set(BUILD_NUMBER 0)
|
|
|
|
if ($ENV{BUILD_NUMBER})
|
2016-10-11 12:13:54 +03:00
|
|
|
set(BUILD_NUMBER $ENV{BUILD_NUMBER})
|
2014-10-09 18:16:47 +04:00
|
|
|
endif()
|
2014-07-11 15:07:36 +04:00
|
|
|
set(WITH_LIBRARY_VERSIONING "ON")
|
2015-11-05 14:29:41 +03:00
|
|
|
set(FREERDP_VERSION_MAJOR "2")
|
|
|
|
set(FREERDP_VERSION_MINOR "0")
|
|
|
|
set(FREERDP_VERSION_REVISION "0")
|
2014-11-11 22:43:15 +03:00
|
|
|
set(FREERDP_VERSION_SUFFIX "dev")
|
2016-01-13 19:37:19 +03:00
|
|
|
set(FREERDP_API_VERSION "${FREERDP_VERSION_MAJOR}")
|
|
|
|
set(FREERDP_VERSION "${FREERDP_VERSION_MAJOR}.${FREERDP_VERSION_MINOR}.${FREERDP_VERSION_REVISION}")
|
2012-11-14 15:32:33 +04:00
|
|
|
if (FREERDP_VERSION_SUFFIX)
|
2012-11-18 20:07:33 +04:00
|
|
|
set(FREERDP_VERSION_FULL "${FREERDP_VERSION}-${FREERDP_VERSION_SUFFIX}")
|
2012-11-14 15:32:33 +04:00
|
|
|
else()
|
2012-11-18 20:07:33 +04:00
|
|
|
set(FREERDP_VERSION_FULL "${FREERDP_VERSION}")
|
2012-11-14 15:32:33 +04:00
|
|
|
endif()
|
2016-01-08 16:07:35 +03:00
|
|
|
set(FREERDP_INCLUDE_DIR "include/freerdp${FREERDP_VERSION_MAJOR}/")
|
2013-01-29 15:59:58 +04:00
|
|
|
|
2016-06-15 14:36:27 +03:00
|
|
|
# Compatibility options
|
|
|
|
if(DEFINED STATIC_CHANNELS)
|
|
|
|
message(WARNING "STATIC_CHANNELS is obsolete, please use BUILTIN_CHANNELS instead")
|
|
|
|
set(BUILTIN_CHANNELS ${STATIC_CHANNELS} CACHE BOOL "" FORCE)
|
|
|
|
endif()
|
|
|
|
|
2016-02-01 17:21:07 +03:00
|
|
|
# Make paths absolute
|
|
|
|
if (CMAKE_INSTALL_PREFIX)
|
|
|
|
get_filename_component(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" ABSOLUTE)
|
|
|
|
endif()
|
|
|
|
if (FREERDP_EXTERNAL_PATH)
|
|
|
|
get_filename_component (FREERDP_EXTERNAL_PATH "${FREERDP_EXTERNAL_PATH}" ABSOLUTE)
|
|
|
|
endif()
|
2013-01-29 15:59:58 +04:00
|
|
|
|
|
|
|
# Allow to search the host machine for git
|
2016-06-03 14:02:30 +03:00
|
|
|
if(CMAKE_CROSSCOMPILING)
|
2013-11-18 22:58:01 +04:00
|
|
|
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
|
2016-06-03 14:02:30 +03:00
|
|
|
endif(CMAKE_CROSSCOMPILING)
|
2016-02-01 17:21:07 +03:00
|
|
|
|
2012-07-27 05:08:30 +04:00
|
|
|
include(GetGitRevisionDescription)
|
2014-10-09 18:14:24 +04:00
|
|
|
git_get_exact_tag(GIT_REVISION --tags --always)
|
2016-02-01 17:21:07 +03:00
|
|
|
|
2014-10-09 18:14:24 +04:00
|
|
|
if (${GIT_REVISION} STREQUAL "n/a")
|
2016-02-01 17:21:07 +03:00
|
|
|
git_rev_parse (GIT_REVISION --short)
|
2014-10-09 18:14:24 +04:00
|
|
|
endif()
|
2016-06-03 14:02:30 +03:00
|
|
|
if(CMAKE_CROSSCOMPILING)
|
2016-02-01 17:21:07 +03:00
|
|
|
SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
|
2016-06-03 14:02:30 +03:00
|
|
|
endif(CMAKE_CROSSCOMPILING)
|
2013-01-29 15:59:58 +04:00
|
|
|
|
2012-07-27 05:08:30 +04:00
|
|
|
message(STATUS "Git Revision ${GIT_REVISION}")
|
2011-07-01 04:31:07 +04:00
|
|
|
|
2012-10-01 06:58:59 +04:00
|
|
|
# Turn on solution folders (2.8.4+)
|
|
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
|
|
|
|
2011-07-01 04:31:07 +04:00
|
|
|
# Default to release build type
|
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
2013-04-30 03:53:56 +04:00
|
|
|
set(CMAKE_BUILD_TYPE "Release")
|
2013-03-19 06:29:52 +04:00
|
|
|
endif()
|
|
|
|
|
2012-03-21 23:46:37 +04:00
|
|
|
if(NOT DEFINED BUILD_SHARED_LIBS)
|
2016-02-01 17:21:07 +03:00
|
|
|
if(IOS OR APPLE)
|
2012-10-23 03:01:19 +04:00
|
|
|
set(BUILD_SHARED_LIBS OFF)
|
|
|
|
else()
|
|
|
|
set(BUILD_SHARED_LIBS ON)
|
|
|
|
endif()
|
2011-09-01 18:18:58 +04:00
|
|
|
endif()
|
|
|
|
|
2016-02-26 21:25:49 +03:00
|
|
|
if(BUILD_TESTING)
|
2016-10-11 12:13:54 +03:00
|
|
|
set(EXPORT_ALL_SYMBOLS TRUE)
|
2016-02-26 21:25:49 +03:00
|
|
|
elseif(NOT DEFINED EXPORT_ALL_SYMBOLS)
|
2016-10-11 12:13:54 +03:00
|
|
|
set(EXPORT_ALL_SYMBOLS FALSE)
|
2012-10-19 06:05:06 +04:00
|
|
|
endif()
|
|
|
|
|
2016-08-02 12:46:11 +03:00
|
|
|
if (EXPORT_ALL_SYMBOLS)
|
2016-10-11 12:13:54 +03:00
|
|
|
# set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
|
|
|
add_definitions(-DFREERDP_TEST_EXPORTS -DBUILD_TESTING)
|
2016-08-02 12:46:11 +03:00
|
|
|
endif(EXPORT_ALL_SYMBOLS)
|
|
|
|
|
2015-04-22 16:19:04 +03:00
|
|
|
# BSD
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "BSD")
|
|
|
|
set(BSD TRUE)
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
|
|
|
set(FREEBSD TRUE)
|
|
|
|
endif()
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
|
|
|
|
set(OPENBSD TRUE)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2012-09-22 03:28:47 +04:00
|
|
|
# Configure MSVC Runtime
|
|
|
|
if(MSVC)
|
|
|
|
include(MSVCRuntime)
|
|
|
|
if(NOT DEFINED MSVC_RUNTIME)
|
|
|
|
set(MSVC_RUNTIME "dynamic")
|
|
|
|
endif()
|
2016-06-15 14:36:27 +03:00
|
|
|
if(MSVC_RUNTIME STREQUAL "static")
|
|
|
|
if(BUILD_SHARED_LIBS)
|
|
|
|
message(FATAL_ERROR "Static CRT is only supported in a fully static build")
|
|
|
|
endif()
|
2012-09-23 01:10:08 +04:00
|
|
|
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()
|
2012-09-22 03:28:47 +04:00
|
|
|
configure_msvc_runtime()
|
2013-04-11 05:15:38 +04:00
|
|
|
|
|
|
|
if(NOT DEFINED CMAKE_SUPPRESS_REGENERATION)
|
|
|
|
set(CMAKE_SUPPRESS_REGENERATION ON)
|
|
|
|
endif()
|
2012-09-22 03:28:47 +04:00
|
|
|
endif()
|
|
|
|
|
2011-08-11 11:03:08 +04:00
|
|
|
# Compiler-specific flags
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCC)
|
2013-01-25 17:27:47 +04:00
|
|
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "i686")
|
2015-01-29 07:50:12 +03:00
|
|
|
CHECK_SYMBOL_EXISTS(__x86_64__ "" IS_X86_64)
|
|
|
|
if(IS_X86_64)
|
2013-04-30 00:37:11 +04:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
|
|
|
else()
|
2013-01-25 17:27:47 +04:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i686")
|
|
|
|
endif()
|
2013-09-19 20:08:20 +04:00
|
|
|
else()
|
|
|
|
if(CMAKE_POSITION_INDEPENDENT_CODE)
|
|
|
|
if(${CMAKE_VERSION} VERSION_LESS 2.8.9)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
|
|
|
endif()
|
|
|
|
endif()
|
2012-12-18 18:11:04 +04:00
|
|
|
endif()
|
2013-09-19 20:08:20 +04:00
|
|
|
|
2011-09-20 07:02:07 +04:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
|
2014-03-12 21:55:38 +04:00
|
|
|
|
2011-10-05 02:47:21 +04:00
|
|
|
CHECK_C_COMPILER_FLAG (-Wno-unused-result Wno-unused-result)
|
|
|
|
if(Wno-unused-result)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-result")
|
|
|
|
endif()
|
2011-09-20 07:02:07 +04:00
|
|
|
CHECK_C_COMPILER_FLAG (-Wno-unused-but-set-variable Wno-unused-but-set-variable)
|
|
|
|
if(Wno-unused-but-set-variable)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-but-set-variable")
|
|
|
|
endif()
|
2012-10-17 10:14:19 +04:00
|
|
|
CHECK_C_COMPILER_FLAG(-Wno-deprecated-declarations Wno-deprecated-declarations)
|
|
|
|
if(Wno-deprecated-declarations)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations")
|
2014-04-30 14:05:51 +04:00
|
|
|
endif()
|
|
|
|
CHECK_CXX_COMPILER_FLAG(-Wno-deprecated-declarations Wno-deprecated-declarationsCXX)
|
|
|
|
if(Wno-deprecated-declarationsCXX)
|
2013-12-05 21:12:55 +04:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
|
2012-10-17 10:14:19 +04:00
|
|
|
endif()
|
2014-04-30 14:11:28 +04:00
|
|
|
|
2012-10-19 06:05:06 +04:00
|
|
|
if(NOT EXPORT_ALL_SYMBOLS)
|
|
|
|
message(STATUS "GCC default symbol visibility: hidden")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
|
|
|
|
endif()
|
2012-10-18 23:37:00 +04:00
|
|
|
if(BUILD_TESTING)
|
|
|
|
CHECK_C_COMPILER_FLAG(-Wno-format Wno-format)
|
|
|
|
if(Wno-format)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-format")
|
|
|
|
endif()
|
|
|
|
endif()
|
2015-03-03 21:25:42 +03:00
|
|
|
CHECK_C_COMPILER_FLAG (-Wimplicit-function-declaration Wimplicit-function-declaration)
|
|
|
|
if(Wimplicit-function-declaration)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wimplicit-function-declaration")
|
|
|
|
endif()
|
2015-04-22 16:19:04 +03:00
|
|
|
|
|
|
|
if (NOT OPENBSD)
|
|
|
|
CHECK_C_COMPILER_FLAG (-Wredundant-decls Wredundant-decls)
|
|
|
|
if(Wredundant-decls)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wredundant-decls")
|
|
|
|
endif()
|
2015-03-03 21:25:42 +03:00
|
|
|
endif()
|
2011-08-25 06:53:06 +04:00
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
2016-08-10 11:29:02 +03:00
|
|
|
add_definitions(-DNDEBUG)
|
2016-10-12 12:24:29 +03:00
|
|
|
else()
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
|
|
|
|
endif()
|
|
|
|
if(WITH_SSE2)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2")
|
|
|
|
endif()
|
|
|
|
endif()
|
2014-04-30 14:11:28 +04:00
|
|
|
|
2016-10-12 12:24:29 +03:00
|
|
|
# When building with Unix Makefiles and doing any release builds
|
|
|
|
# try to set __FILE__ to relative paths via a make specific macro
|
|
|
|
if (CMAKE_GENERATOR MATCHES "Unix Makefile*")
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
|
|
|
string(TOUPPER ${CMAKE_BUILD_TYPE} UPPER_BUILD_TYPE)
|
2014-04-30 14:11:28 +04:00
|
|
|
CHECK_C_COMPILER_FLAG (-Wno-builtin-macro-redefined Wno-builtin-macro-redefined)
|
|
|
|
if(Wno-builtin-macro-redefined)
|
2016-10-12 12:24:29 +03:00
|
|
|
set(CMAKE_C_FLAGS_${UPPER_BUILD_TYPE} "${CMAKE_C_FLAGS_${UPPER_BUILD_TYPE}} -Wno-builtin-macro-redefined -D__FILE__='\"$(subst ${CMAKE_BINARY_DIR}/,,$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<)))\"'")
|
2014-04-30 14:11:28 +04:00
|
|
|
endif()
|
|
|
|
|
|
|
|
CHECK_CXX_COMPILER_FLAG (-Wno-builtin-macro-redefined Wno-builtin-macro-redefinedCXX)
|
|
|
|
if(Wno-builtin-macro-redefinedCXX)
|
2016-10-12 12:24:29 +03:00
|
|
|
set(CMAKE_CXX_FLAGS_${UPPER_BUILD_TYPE} "${CMAKE_CXX_FLAGS_${UPPER_BUILD_TYPE}} -Wno-builtin-macro-redefined -D__FILE__='\"$(subst ${CMAKE_BINARY_DIR}/,,$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<)))\"'")
|
2014-04-30 14:11:28 +04:00
|
|
|
endif()
|
2012-10-13 01:55:12 +04:00
|
|
|
endif()
|
2011-08-11 11:03:08 +04:00
|
|
|
endif()
|
|
|
|
|
2015-06-17 14:23:21 +03:00
|
|
|
if(${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
|
2013-10-25 17:48:02 +04:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter")
|
2013-08-30 16:18:49 +04:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-macros -Wno-padded")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-c11-extensions -Wno-gnu")
|
2013-05-31 21:51:50 +04:00
|
|
|
if(WITH_SSE2)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mssse3")
|
|
|
|
endif()
|
2013-09-10 22:03:15 +04:00
|
|
|
CHECK_C_COMPILER_FLAG(-Wno-deprecated-declarations Wno-deprecated-declarations)
|
|
|
|
if(Wno-deprecated-declarations)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations")
|
2014-04-30 14:05:51 +04:00
|
|
|
endif()
|
|
|
|
CHECK_CXX_COMPILER_FLAG(-Wno-deprecated-declarations Wno-deprecated-declarationsCXX)
|
|
|
|
if(Wno-deprecated-declarationsCXX)
|
2013-12-05 21:12:55 +04:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
|
2013-09-10 22:03:15 +04:00
|
|
|
endif()
|
2013-05-31 21:51:50 +04:00
|
|
|
endif()
|
|
|
|
|
2015-12-21 10:00:14 +03:00
|
|
|
# Enable address sanitizer, where supported and when required
|
|
|
|
if(${CMAKE_C_COMPILER_ID} STREQUAL "Clang" OR CMAKE_COMPILER_IS_GNUCC)
|
|
|
|
if(WITH_SANITIZE_ADDRESS)
|
|
|
|
if (DEFINED CMAKE_REQUIRED_FLAGS)
|
|
|
|
set(SAVE_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
|
|
|
|
endif()
|
|
|
|
set(CMAKE_REQUIRED_FLAGS "-fsanitize=address")
|
|
|
|
CHECK_C_COMPILER_FLAG ("-fsanitize=address" fsanitize-address)
|
|
|
|
if(fsanitize-address)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
|
|
|
|
endif()
|
|
|
|
if (DEFINED SAVE_CMAKE_REQUIRED_FLAGS)
|
|
|
|
set(CMAKE_REQUIRED_FLAGS ${SAVE_CMAKE_REQUIRED_FLAGS})
|
|
|
|
else()
|
|
|
|
unset(CMAKE_REQUIRED_FLAGS)
|
|
|
|
endif()
|
|
|
|
|
2016-10-10 10:29:09 +03:00
|
|
|
CHECK_C_COMPILER_FLAG ("-fno-omit-frame-pointer" fno-omit-frame-pointer)
|
|
|
|
if(fno-omit-frame-pointer)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer")
|
|
|
|
endif()
|
|
|
|
elseif(WITH_SANITIZE_LEAK)
|
|
|
|
if (DEFINED CMAKE_REQUIRED_FLAGS)
|
|
|
|
set(SAVE_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
|
|
|
|
endif()
|
|
|
|
set(CMAKE_REQUIRED_FLAGS "-fsanitize=leak")
|
|
|
|
CHECK_C_COMPILER_FLAG ("-fsanitize=leak" fsanitize-leak)
|
|
|
|
if(fsanitize-leak)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=leak")
|
|
|
|
endif()
|
|
|
|
if (DEFINED SAVE_CMAKE_REQUIRED_FLAGS)
|
|
|
|
set(CMAKE_REQUIRED_FLAGS ${SAVE_CMAKE_REQUIRED_FLAGS})
|
|
|
|
else()
|
|
|
|
unset(CMAKE_REQUIRED_FLAGS)
|
|
|
|
endif()
|
|
|
|
|
2015-12-21 10:00:14 +03:00
|
|
|
CHECK_C_COMPILER_FLAG ("-fno-omit-frame-pointer" fno-omit-frame-pointer)
|
|
|
|
if(fno-omit-frame-pointer)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer")
|
|
|
|
endif()
|
|
|
|
endif()
|
2016-10-10 10:29:09 +03:00
|
|
|
|
2016-04-19 15:33:26 +03:00
|
|
|
if (WITH_NO_UNDEFINED)
|
|
|
|
if (DEFINED CMAKE_REQUIRED_FLAGS)
|
|
|
|
set(SAVE_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
|
|
|
|
endif()
|
|
|
|
set(CMAKE_REQUIRED_FLAGS "-Wl,--no-undefined")
|
|
|
|
CHECK_C_COMPILER_FLAG (-Wl,--no-undefined no-undefined)
|
|
|
|
if (DEFINED SAVE_CMAKE_REQUIRED_FLAGS)
|
|
|
|
set(CMAKE_REQUIRED_FLAGS ${SAVE_CMAKE_REQUIRED_FLAGS})
|
|
|
|
unset(SAVE_CMAKE_REQUIRED_FLAGS)
|
|
|
|
else()
|
|
|
|
unset(CMAKE_REQUIRED_FLAGS)
|
|
|
|
endif()
|
|
|
|
if(no-undefined)
|
|
|
|
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
|
|
|
|
endif()
|
|
|
|
endif()
|
2015-12-21 10:00:14 +03:00
|
|
|
endif()
|
|
|
|
|
2011-08-16 22:41:12 +04:00
|
|
|
if(MSVC)
|
2015-02-23 18:48:07 +03:00
|
|
|
# Remove previous warning definitions,
|
|
|
|
# NMake is otherwise complaining.
|
|
|
|
foreach (flags_var_to_scrub
|
|
|
|
CMAKE_C_FLAGS
|
|
|
|
CMAKE_CXX_FLAGS
|
|
|
|
CMAKE_CXX_FLAGS_RELEASE
|
|
|
|
CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
|
|
|
CMAKE_CXX_FLAGS_MINSIZEREL
|
|
|
|
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()
|
|
|
|
|
2012-09-03 18:47:45 +04:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Gd")
|
2014-02-10 09:34:17 +04:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3")
|
|
|
|
|
2012-08-08 04:48:29 +04:00
|
|
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
2016-08-10 11:29:02 +03:00
|
|
|
add_definitions(-D_AMD64_)
|
2012-08-08 04:48:29 +04:00
|
|
|
else()
|
2016-08-10 11:29:02 +03:00
|
|
|
add_definitions(-D_X86_)
|
2012-08-08 04:48:29 +04:00
|
|
|
endif()
|
2014-02-10 09:34:17 +04:00
|
|
|
|
|
|
|
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
|
|
|
|
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
|
2013-07-24 23:36:15 +04:00
|
|
|
|
2016-02-01 17:21:07 +03:00
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
|
|
|
else()
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Zi")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi")
|
|
|
|
endif()
|
2013-07-24 23:36:15 +04:00
|
|
|
|
2011-08-16 22:41:12 +04:00
|
|
|
endif()
|
|
|
|
|
2013-04-09 07:08:16 +04:00
|
|
|
if(WIN32)
|
2016-08-10 11:29:02 +03:00
|
|
|
add_definitions(-DUNICODE -D_UNICODE)
|
|
|
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
|
|
|
add_definitions(-DWIN32_LEAN_AND_MEAN)
|
|
|
|
add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS)
|
2014-07-17 23:11:04 +04:00
|
|
|
|
2015-08-19 10:02:20 +03:00
|
|
|
set(CMAKE_USE_RELATIVE_PATH ON)
|
|
|
|
if (${CMAKE_GENERATOR} MATCHES "NMake Makefile*")
|
|
|
|
set(CMAKE_PDB_BINARY_DIR ${CMAKE_BINARY_DIR})
|
|
|
|
elseif (${CMAKE_GENERATOR} MATCHES "Visual Studio*")
|
|
|
|
set(CMAKE_PDB_BINARY_DIR "${CMAKE_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}")
|
|
|
|
else()
|
|
|
|
message(FATAL "Unknown generator ${CMAKE_GENERATOR}")
|
|
|
|
endif()
|
|
|
|
|
2015-10-05 23:23:44 +03:00
|
|
|
# Set product and vendor for dll and exe version information.
|
|
|
|
set(RC_VERSION_VENDOR ${VENDOR})
|
|
|
|
set(RC_VERSION_PRODUCT ${PRODUCT})
|
|
|
|
set(RC_VERSION_PATCH ${BUILD_NUMBER})
|
|
|
|
set(RC_VERSION_DESCRIPTION ${GIT_REVISION})
|
2014-10-09 18:14:24 +04:00
|
|
|
|
2015-10-05 23:23:44 +03:00
|
|
|
string(TIMESTAMP RC_VERSION_YEAR "%Y")
|
2014-10-03 17:17:40 +04:00
|
|
|
|
2014-07-17 23:11:04 +04:00
|
|
|
if(NOT DEFINED CMAKE_WINDOWS_VERSION)
|
|
|
|
set(CMAKE_WINDOWS_VERSION "WINXP")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CMAKE_WINDOWS_VERSION STREQUAL "WINXP")
|
2016-08-10 11:29:02 +03:00
|
|
|
add_definitions(-DWINVER=0x0501 -D_WIN32_WINNT=0x0501)
|
2014-07-17 23:11:04 +04:00
|
|
|
elseif(CMAKE_WINDOWS_VERSION STREQUAL "WIN7")
|
2016-08-10 11:29:02 +03:00
|
|
|
add_definitions(-DWINVER=0x0601 -D_WIN32_WINNT=0x0601)
|
2014-07-17 23:11:04 +04:00
|
|
|
elseif(CMAKE_WINDOWS_VERSION STREQUAL "WIN8")
|
2016-08-10 11:29:02 +03:00
|
|
|
add_definitions(-DWINVER=0x0602 -D_WIN32_WINNT=0x0602)
|
2016-03-29 23:03:15 +03:00
|
|
|
elseif(CMAKE_WINDOWS_VERSION STREQUAL "WIN10")
|
2016-08-10 11:29:02 +03:00
|
|
|
add_definitions(-DWINVER=0x0A00 -D_WIN32_WINNT=0x0A00)
|
2014-07-17 23:11:04 +04:00
|
|
|
endif()
|
2015-02-23 18:48:07 +03:00
|
|
|
|
2014-09-26 13:16:04 +04:00
|
|
|
if (FREERDP_EXTERNAL_SSL_PATH)
|
|
|
|
set(OPENSSL_ROOT_DIR ${FREERDP_EXTERNAL_SSL_PATH})
|
|
|
|
endif()
|
2013-04-09 07:08:16 +04:00
|
|
|
endif()
|
|
|
|
|
2013-02-14 17:59:12 +04:00
|
|
|
if(IOS)
|
2013-03-29 17:28:27 +04:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -isysroot ${CMAKE_IOS_SDK_ROOT} -g")
|
2013-02-14 17:59:12 +04:00
|
|
|
endif()
|
|
|
|
|
2016-08-10 11:29:02 +03:00
|
|
|
add_definitions(-DWINPR_EXPORTS -DFREERDP_EXPORTS)
|
2014-02-03 07:37:54 +04:00
|
|
|
|
2011-07-04 07:40:26 +04:00
|
|
|
# Include files
|
2013-03-29 17:28:27 +04:00
|
|
|
if(NOT IOS)
|
2014-02-03 07:37:54 +04:00
|
|
|
check_include_files(fcntl.h HAVE_FCNTL_H)
|
|
|
|
check_include_files(unistd.h HAVE_UNISTD_H)
|
2014-08-14 12:36:50 +04:00
|
|
|
check_include_files(execinfo.h HAVE_EXECINFO_H)
|
2014-02-03 07:37:54 +04:00
|
|
|
check_include_files(inttypes.h HAVE_INTTYPES_H)
|
|
|
|
check_include_files(sys/modem.h HAVE_SYS_MODEM_H)
|
|
|
|
check_include_files(sys/filio.h HAVE_SYS_FILIO_H)
|
2015-05-21 23:24:03 +03:00
|
|
|
check_include_files(sys/sockio.h HAVE_SYS_SOCKIO_H)
|
2014-02-03 07:37:54 +04:00
|
|
|
check_include_files(sys/strtio.h HAVE_SYS_STRTIO_H)
|
|
|
|
check_include_files(sys/select.h HAVE_SYS_SELECT_H)
|
2015-10-21 17:13:15 +03:00
|
|
|
check_include_files(syslog.h HAVE_SYSLOG_H)
|
2013-03-29 17:28:27 +04:00
|
|
|
else()
|
2014-02-03 07:37:54 +04:00
|
|
|
set(HAVE_FCNTL_H 1)
|
|
|
|
set(HAVE_UNISTD_H 1)
|
|
|
|
set(HAVE_INTTYPES_H 1)
|
|
|
|
set(HAVE_SYS_FILIO_H 1)
|
2013-03-29 17:28:27 +04:00
|
|
|
endif()
|
2011-07-04 07:40:26 +04:00
|
|
|
|
2013-03-29 17:28:27 +04:00
|
|
|
if(NOT IOS)
|
2014-02-03 07:37:54 +04:00
|
|
|
check_struct_has_member("struct tm" tm_gmtoff time.h HAVE_TM_GMTOFF)
|
2013-03-29 17:28:27 +04:00
|
|
|
else()
|
2014-02-03 07:37:54 +04:00
|
|
|
set(HAVE_TM_GMTOFF 1)
|
2013-03-29 17:28:27 +04:00
|
|
|
endif()
|
2012-02-16 01:28:47 +04:00
|
|
|
|
2011-11-16 08:21:53 +04:00
|
|
|
# Mac OS X
|
|
|
|
if(APPLE)
|
2013-09-24 03:41:18 +04:00
|
|
|
if(IOS)
|
|
|
|
if (NOT FREERDP_IOS_EXTERNAL_SSL_PATH)
|
|
|
|
message(STATUS "FREERDP_IOS_EXTERNAL_SSL_PATH not set! Required if openssl is not found in the iOS SDK (which usually isn't")
|
|
|
|
endif()
|
|
|
|
set(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH} ${FREERDP_IOS_EXTERNAL_SSL_PATH})
|
|
|
|
set_property(GLOBAL PROPERTY XCODE_ATTRIBUTE_SKIP_INSTALL YES)
|
|
|
|
else(IOS)
|
2013-08-10 05:23:08 +04:00
|
|
|
if(NOT DEFINED CMAKE_OSX_ARCHITECTURES)
|
|
|
|
set(CMAKE_OSX_ARCHITECTURES i386 x86_64)
|
|
|
|
endif()
|
|
|
|
|
2013-09-24 03:41:18 +04:00
|
|
|
if(IS_DIRECTORY /opt/local/include)
|
|
|
|
include_directories(/opt/local/include)
|
|
|
|
link_directories(/opt/local/lib)
|
|
|
|
endif()
|
|
|
|
endif(IOS)
|
2013-08-09 00:10:23 +04:00
|
|
|
|
2013-09-11 18:36:38 +04:00
|
|
|
# Temporarily disabled, causes the cmake script to be reexecuted, causing the compilation to fail.
|
|
|
|
# Workaround: specify the parameter in the command-line
|
2016-02-01 17:21:07 +03:00
|
|
|
# if(WITH_CLANG)
|
|
|
|
# set(CMAKE_C_COMPILER "clang")
|
|
|
|
# endif()
|
2013-06-11 22:56:43 +04:00
|
|
|
|
2013-09-24 03:41:18 +04:00
|
|
|
if (WITH_VERBOSE)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -v")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -v")
|
|
|
|
endif()
|
|
|
|
endif(APPLE)
|
2011-11-16 08:21:53 +04:00
|
|
|
|
2015-04-21 21:42:06 +03:00
|
|
|
# OpenBSD
|
|
|
|
if(OPENBSD)
|
2015-04-24 15:38:35 +03:00
|
|
|
set(WITH_MANPAGES "ON")
|
|
|
|
set(WITH_ALSA "OFF")
|
2016-02-01 17:21:07 +03:00
|
|
|
set(WITH_PULSE "OFF")
|
|
|
|
set(WITH_OSS "ON")
|
2015-04-21 21:42:06 +03:00
|
|
|
set(WITH_WAYLAND "OFF")
|
2015-03-10 01:21:28 +03:00
|
|
|
endif()
|
|
|
|
|
2013-01-29 15:59:58 +04:00
|
|
|
# Android
|
|
|
|
if(ANDROID)
|
2016-02-01 17:21:07 +03:00
|
|
|
set(WITH_LIBRARY_VERSIONING "OFF")
|
|
|
|
|
2016-10-11 12:13:54 +03:00
|
|
|
set_property( GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ${ANDROID_LIBRARY_USE_LIB64_PATHS} )
|
2016-06-03 14:02:30 +03:00
|
|
|
|
2016-02-01 17:21:07 +03:00
|
|
|
if (${ANDROID_ABI} STREQUAL "armeabi")
|
|
|
|
set (WITH_NEON OFF)
|
|
|
|
endif()
|
2014-04-29 11:42:18 +04:00
|
|
|
|
2013-09-23 14:39:41 +04:00
|
|
|
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
|
|
|
add_definitions(-DNDK_DEBUG=1)
|
2013-11-08 19:32:50 +04:00
|
|
|
|
|
|
|
# NOTE: Manually add -gdwarf-3, as newer toolchains default to -gdwarf-4,
|
|
|
|
# which is not supported by the gdbserver binary shipped with
|
|
|
|
# the android NDK (tested with r9b)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_DEBUG} -gdwarf-3")
|
2013-09-23 14:39:41 +04:00
|
|
|
endif()
|
2013-09-23 19:48:02 +04:00
|
|
|
set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -llog")
|
2013-11-21 12:45:35 +04:00
|
|
|
|
2016-02-01 17:21:07 +03:00
|
|
|
if (NOT FREERDP_EXTERNAL_PATH)
|
|
|
|
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/external/")
|
|
|
|
set (FREERDP_EXTERNAL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external/")
|
2013-03-24 02:13:10 +04:00
|
|
|
else()
|
2016-02-01 17:21:07 +03:00
|
|
|
message(STATUS "FREERDP_EXTERNAL_PATH not set!")
|
2013-09-18 14:50:10 +04:00
|
|
|
endif()
|
2013-01-29 15:59:58 +04:00
|
|
|
endif()
|
2013-11-21 12:45:35 +04:00
|
|
|
|
2016-02-01 17:21:07 +03:00
|
|
|
list (APPEND CMAKE_INCLUDE_PATH ${FREERDP_EXTERNAL_PATH}/include)
|
|
|
|
list (APPEND CMAKE_LIBRARY_PATH ${FREERDP_EXTERNAL_PATH}/${ANDROID_ABI}/ )
|
|
|
|
set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH )
|
|
|
|
set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH )
|
|
|
|
|
2013-11-18 15:50:32 +04:00
|
|
|
if (WITH_GPROF)
|
2016-02-01 17:21:07 +03:00
|
|
|
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/scripts/gprof_generate.sh.cmake
|
|
|
|
${CMAKE_BINARY_DIR}/scripts/gprof_generate.sh @ONLY)
|
2013-11-18 15:50:32 +04:00
|
|
|
endif(WITH_GPROF)
|
2013-01-29 15:59:58 +04:00
|
|
|
endif()
|
|
|
|
|
2012-11-03 03:27:01 +04:00
|
|
|
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
2013-04-30 03:53:56 +04:00
|
|
|
|
2016-06-02 16:33:00 +03:00
|
|
|
if(NOT IOS)
|
2012-12-20 16:13:36 +04:00
|
|
|
find_package(Threads REQUIRED)
|
2012-12-20 16:09:33 +04:00
|
|
|
endif()
|
2012-11-03 03:27:01 +04:00
|
|
|
|
2014-02-03 07:37:54 +04:00
|
|
|
if(NOT WIN32)
|
2016-06-03 15:23:06 +03:00
|
|
|
CHECK_SYMBOL_EXISTS(pthread_mutex_timedlock pthread.h HAVE_PTHREAD_MUTEX_TIMEDLOCK_SYMBOL)
|
|
|
|
if (NOT HAVE_PTHREAD_MUTEX_TIMEDLOCK_SYMBOL)
|
|
|
|
CHECK_LIBRARY_EXISTS(pthread pthread_mutex_timedlock "" HAVE_PTHREAD_MUTEX_TIMEDLOCK_LIB)
|
|
|
|
endif (NOT HAVE_PTHREAD_MUTEX_TIMEDLOCK_SYMBOL)
|
|
|
|
if (NOT HAVE_PTHREAD_MUTEX_TIMEDLOCK_LIB)
|
|
|
|
CHECK_LIBRARY_EXISTS(pthreads pthread_mutex_timedlock "" HAVE_PTHREAD_MUTEX_TIMEDLOCK_LIBS)
|
|
|
|
endif (NOT HAVE_PTHREAD_MUTEX_TIMEDLOCK_LIB)
|
|
|
|
|
|
|
|
if (HAVE_PTHREAD_MUTEX_TIMEDLOCK_SYMBOL OR HAVE_PTHREAD_MUTEX_TIMEDLOCK_LIB OR HAVE_PTHREAD_MUTEX_TIMEDLOCK_LIBS)
|
|
|
|
set(HAVE_PTHREAD_MUTEX_TIMEDLOCK ON)
|
|
|
|
endif (HAVE_PTHREAD_MUTEX_TIMEDLOCK_SYMBOL OR HAVE_PTHREAD_MUTEX_TIMEDLOCK_LIB OR HAVE_PTHREAD_MUTEX_TIMEDLOCK_LIBS)
|
2014-02-03 07:37:54 +04:00
|
|
|
endif()
|
2013-11-15 19:04:04 +04:00
|
|
|
|
2014-05-12 20:01:29 +04:00
|
|
|
if(WITH_VALGRIND_MEMCHECK)
|
2016-02-01 17:21:07 +03:00
|
|
|
check_include_files(valgrind/memcheck.h HAVE_VALGRIND_MEMCHECK_H)
|
2014-05-12 20:01:29 +04:00
|
|
|
else()
|
2016-02-01 17:21:07 +03:00
|
|
|
unset(HAVE_VALGRIND_MEMCHECK_H CACHE)
|
2014-05-12 20:01:29 +04:00
|
|
|
endif()
|
|
|
|
|
2012-11-03 03:27:01 +04:00
|
|
|
if(UNIX OR CYGWIN)
|
2013-08-23 06:36:37 +04:00
|
|
|
check_include_files(sys/eventfd.h HAVE_AIO_H)
|
2013-01-24 00:59:01 +04:00
|
|
|
check_include_files(sys/eventfd.h HAVE_EVENTFD_H)
|
2015-04-28 09:30:45 +03:00
|
|
|
if (HAVE_EVENTFD_H)
|
|
|
|
check_symbol_exists(eventfd_read sys/eventfd.h WITH_EVENTFD_READ_WRITE)
|
|
|
|
endif()
|
2013-08-04 03:50:17 +04:00
|
|
|
check_include_files(sys/timerfd.h HAVE_TIMERFD_H)
|
2014-07-02 17:15:46 +04:00
|
|
|
check_include_files(poll.h HAVE_POLL_H)
|
2015-05-03 20:46:22 +03:00
|
|
|
list(APPEND CMAKE_REQUIRED_LIBRARIES m)
|
|
|
|
check_symbol_exists(ceill math.h HAVE_MATH_C99_LONG_DOUBLE)
|
|
|
|
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES m)
|
2012-11-03 03:27:01 +04:00
|
|
|
set(X11_FEATURE_TYPE "RECOMMENDED")
|
2014-10-13 13:43:16 +04:00
|
|
|
set(WAYLAND_FEATURE_TYPE "RECOMMENDED")
|
2012-11-03 03:27:01 +04:00
|
|
|
else()
|
|
|
|
set(X11_FEATURE_TYPE "DISABLED")
|
2014-10-13 13:43:16 +04:00
|
|
|
set(WAYLAND_FEATURE_TYPE "DISABLED")
|
2012-10-14 04:31:01 +04:00
|
|
|
endif()
|
|
|
|
|
2014-04-28 01:38:45 +04:00
|
|
|
if(WITH_PCSC_WINPR)
|
|
|
|
find_package(PCSCWinPR)
|
|
|
|
endif()
|
2014-04-08 09:26:28 +04:00
|
|
|
|
2012-11-03 03:27:01 +04:00
|
|
|
set(X11_FEATURE_PURPOSE "X11")
|
|
|
|
set(X11_FEATURE_DESCRIPTION "X11 client and server")
|
2012-10-14 04:31:01 +04:00
|
|
|
|
2014-10-13 13:43:16 +04:00
|
|
|
set(WAYLAND_FEATURE_PURPOSE "Wayland")
|
|
|
|
set(WAYLAND_FEATURE_DESCRIPTION "Wayland client")
|
|
|
|
|
2012-11-03 03:27:01 +04:00
|
|
|
set(DIRECTFB_FEATURE_TYPE "OPTIONAL")
|
|
|
|
set(DIRECTFB_FEATURE_PURPOSE "DirectFB")
|
|
|
|
set(DIRECTFB_FEATURE_DESCRIPTION "DirectFB client")
|
2011-11-16 08:21:53 +04:00
|
|
|
|
2012-11-03 03:27:01 +04:00
|
|
|
set(ZLIB_FEATURE_TYPE "REQUIRED")
|
|
|
|
set(ZLIB_FEATURE_PURPOSE "compression")
|
|
|
|
set(ZLIB_FEATURE_DESCRIPTION "data compression")
|
2012-10-14 04:31:01 +04:00
|
|
|
|
2012-11-03 03:27:01 +04:00
|
|
|
set(OPENSSL_FEATURE_TYPE "REQUIRED")
|
|
|
|
set(OPENSSL_FEATURE_PURPOSE "cryptography")
|
|
|
|
set(OPENSSL_FEATURE_DESCRIPTION "encryption, certificate validation, hashing functions")
|
|
|
|
|
2015-09-16 03:52:46 +03:00
|
|
|
set(MBEDTLS_FEATURE_TYPE "OPTIONAL")
|
|
|
|
set(MBEDTLS_FEATURE_PURPOSE "cryptography")
|
|
|
|
set(MBEDTLS_FEATURE_DESCRIPTION "encryption, certificate validation, hashing functions")
|
|
|
|
|
2013-09-23 14:39:41 +04:00
|
|
|
set(OPENSLES_FEATURE_TYPE "OPTIONAL")
|
|
|
|
set(OPENSLES_FEATURE_PURPOSE "multimedia")
|
|
|
|
set(OPENSLES_FEATURE_DESCRIPTION "OpenSLES audio / video")
|
|
|
|
|
2015-03-09 09:23:29 +03:00
|
|
|
set(OSS_FEATURE_TYPE "RECOMMENDED")
|
|
|
|
set(OSS_FEATURE_PURPOSE "sound")
|
|
|
|
set(OSS_FEATURE_DESCRIPTION "audio input, audio output and multimedia redirection")
|
|
|
|
|
2012-11-03 03:27:01 +04:00
|
|
|
set(ALSA_FEATURE_TYPE "RECOMMENDED")
|
|
|
|
set(ALSA_FEATURE_PURPOSE "sound")
|
|
|
|
set(ALSA_FEATURE_DESCRIPTION "audio input, audio output and multimedia redirection")
|
|
|
|
|
|
|
|
set(PULSE_FEATURE_TYPE "OPTIONAL")
|
|
|
|
set(PULSE_FEATURE_PURPOSE "sound")
|
|
|
|
set(PULSE_FEATURE_DESCRIPTION "audio input, audio output and multimedia redirection")
|
|
|
|
|
|
|
|
set(CUPS_FEATURE_TYPE "OPTIONAL")
|
|
|
|
set(CUPS_FEATURE_PURPOSE "printing")
|
|
|
|
set(CUPS_FEATURE_DESCRIPTION "printer device redirection")
|
|
|
|
|
|
|
|
set(PCSC_FEATURE_TYPE "OPTIONAL")
|
|
|
|
set(PCSC_FEATURE_PURPOSE "smart card")
|
|
|
|
set(PCSC_FEATURE_DESCRIPTION "smart card device redirection")
|
|
|
|
|
|
|
|
set(FFMPEG_FEATURE_TYPE "RECOMMENDED")
|
|
|
|
set(FFMPEG_FEATURE_PURPOSE "multimedia")
|
|
|
|
set(FFMPEG_FEATURE_DESCRIPTION "multimedia redirection, audio and video playback")
|
|
|
|
|
2014-05-24 20:21:40 +04:00
|
|
|
set(GSTREAMER_0_10_FEATURE_TYPE "OPTIONAL")
|
|
|
|
set(GSTREAMER_0_10_FEATURE_PURPOSE "multimedia")
|
|
|
|
set(GSTREAMER_0_10_FEATURE_DESCRIPTION "multimedia redirection, audio and video playback, gstreamer 0.10 version")
|
|
|
|
|
|
|
|
set(GSTREAMER_1_0_FEATURE_TYPE "RECOMMENDED")
|
|
|
|
set(GSTREAMER_1_0_FEATURE_PURPOSE "multimedia")
|
|
|
|
set(GSTREAMER_1_0_FEATURE_DESCRIPTION "multimedia redirection, audio and video playback")
|
2012-11-03 03:27:01 +04:00
|
|
|
|
2013-01-19 02:32:58 +04:00
|
|
|
set(IPP_FEATURE_TYPE "OPTIONAL")
|
|
|
|
set(IPP_FEATURE_PURPOSE "performance")
|
|
|
|
set(IPP_FEATURE_DESCRIPTION "Intel Integrated Performance Primitives library")
|
|
|
|
|
2013-08-02 12:04:58 +04:00
|
|
|
set(JPEG_FEATURE_TYPE "OPTIONAL")
|
|
|
|
set(JPEG_FEATURE_PURPOSE "codec")
|
|
|
|
set(JPEG_FEATURE_DESCRIPTION "use JPEG library")
|
|
|
|
|
2015-07-28 23:01:34 +03:00
|
|
|
set(X264_FEATURE_TYPE "OPTIONAL")
|
|
|
|
set(X264_FEATURE_PURPOSE "codec")
|
|
|
|
set(X264_FEATURE_DESCRIPTION "use x264 library")
|
|
|
|
|
2014-07-02 07:28:09 +04:00
|
|
|
set(OPENH264_FEATURE_TYPE "OPTIONAL")
|
|
|
|
set(OPENH264_FEATURE_PURPOSE "codec")
|
|
|
|
set(OPENH264_FEATURE_DESCRIPTION "use OpenH264 library")
|
|
|
|
|
2013-11-22 21:11:39 +04:00
|
|
|
set(GSM_FEATURE_TYPE "OPTIONAL")
|
|
|
|
set(GSM_FEATURE_PURPOSE "codec")
|
|
|
|
set(GSM_FEATURE_DESCRIPTION "GSM audio codec library")
|
|
|
|
|
2012-11-03 03:27:01 +04:00
|
|
|
if(WIN32)
|
|
|
|
set(X11_FEATURE_TYPE "DISABLED")
|
2014-10-13 13:43:16 +04:00
|
|
|
set(WAYLAND_FEATURE_TYPE "DISABLED")
|
2012-11-12 02:23:57 +04:00
|
|
|
set(ZLIB_FEATURE_TYPE "DISABLED")
|
2012-11-03 03:27:01 +04:00
|
|
|
set(DIRECTFB_FEATURE_TYPE "DISABLED")
|
2015-03-09 09:23:29 +03:00
|
|
|
set(OSS_FEATURE_TYPE "DISABLED")
|
2012-11-03 03:27:01 +04:00
|
|
|
set(ALSA_FEATURE_TYPE "DISABLED")
|
|
|
|
set(PULSE_FEATURE_TYPE "DISABLED")
|
|
|
|
set(CUPS_FEATURE_TYPE "DISABLED")
|
|
|
|
set(PCSC_FEATURE_TYPE "DISABLED")
|
|
|
|
set(FFMPEG_FEATURE_TYPE "DISABLED")
|
2014-05-24 20:21:40 +04:00
|
|
|
set(GSTREAMER_1_0_FEATURE_TYPE "DISABLED")
|
|
|
|
set(GSTREAMER_0_10_FEATURE_TYPE "OPTIONAL")
|
2013-09-23 14:39:41 +04:00
|
|
|
set(OPENSLES_FEATURE_TYPE "DISABLED")
|
2011-08-16 01:05:48 +04:00
|
|
|
endif()
|
2011-07-31 05:22:09 +04:00
|
|
|
|
2012-11-03 03:27:01 +04:00
|
|
|
if(APPLE)
|
|
|
|
set(DIRECTFB_FEATURE_TYPE "DISABLED")
|
|
|
|
set(FFMPEG_FEATURE_TYPE "OPTIONAL")
|
2014-05-24 20:21:40 +04:00
|
|
|
set(GSTREAMER_1_0_FEATURE_TYPE "OPTIONAL")
|
2013-06-17 13:14:25 +04:00
|
|
|
set(X11_FEATURE_TYPE "OPTIONAL")
|
2014-10-13 13:43:16 +04:00
|
|
|
set(WAYLAND_FEATURE_TYPE "DISABLED")
|
2015-03-09 09:23:29 +03:00
|
|
|
set(OSS_FEATURE_TYPE "DISABLED")
|
2015-01-27 03:16:24 +03:00
|
|
|
set(ALSA_FEATURE_TYPE "DISABLED")
|
2013-02-14 17:59:12 +04:00
|
|
|
if(IOS)
|
2013-06-17 13:14:25 +04:00
|
|
|
set(X11_FEATURE_TYPE "DISABLED")
|
2013-02-14 17:59:12 +04:00
|
|
|
set(PULSE_FEATURE_TYPE "DISABLED")
|
|
|
|
set(CUPS_FEATURE_TYPE "DISABLED")
|
|
|
|
set(PCSC_FEATURE_TYPE "DISABLED")
|
2014-05-24 20:21:40 +04:00
|
|
|
set(GSTREAMER_1_0_FEATURE_TYPE "DISABLED")
|
|
|
|
set(GSTREAMER_0_10_FEATURE_TYPE "DISABLED")
|
2013-02-14 17:59:12 +04:00
|
|
|
endif()
|
2013-09-23 14:39:41 +04:00
|
|
|
set(OPENSLES_FEATURE_TYPE "DISABLED")
|
2012-11-03 03:27:01 +04:00
|
|
|
endif()
|
|
|
|
|
2016-02-01 17:21:07 +03:00
|
|
|
if(UNIX AND NOT ANDROID)
|
|
|
|
set(WLOG_SYSTEMD_JOURNAL_FEATURE_TYPE "RECOMMENDED")
|
|
|
|
set(WLOG_SYSTEMD_JOURNAL_FEATURE_PURPOSE "systemd journal appender")
|
|
|
|
set(WLOG_SYSTEMD_JOURNAL_FEATURE_DESCRIPTION "allows to export wLog to systemd journal")
|
|
|
|
|
|
|
|
#include(Findlibsystemd)
|
|
|
|
find_feature(libsystemd ${WLOG_SYSTEMD_JOURNAL_FEATURE_TYPE} ${WLOG_SYSTEMD_JOURNAL_FEATURE_PURPOSE} ${WLOG_SYSTEMD_JOURNAL_FEATURE_DESCRIPTION})
|
|
|
|
|
|
|
|
if(LIBSYSTEMD_FOUND)
|
|
|
|
set(HAVE_JOURNALD_H TRUE)
|
|
|
|
else()
|
|
|
|
unset(HAVE_JOURNALD_H)
|
|
|
|
endif()
|
|
|
|
endif(UNIX AND NOT ANDROID)
|
|
|
|
|
2012-11-03 03:27:01 +04:00
|
|
|
if(ANDROID)
|
|
|
|
set(X11_FEATURE_TYPE "DISABLED")
|
2014-10-13 13:43:16 +04:00
|
|
|
set(WAYLAND_FEATURE_TYPE "DISABLED")
|
2012-11-03 03:27:01 +04:00
|
|
|
set(DIRECTFB_FEATURE_TYPE "DISABLED")
|
2015-03-09 09:23:29 +03:00
|
|
|
set(OSS_FEATURE_TYPE "DISABLED")
|
2012-11-03 03:27:01 +04:00
|
|
|
set(ALSA_FEATURE_TYPE "DISABLED")
|
|
|
|
set(PULSE_FEATURE_TYPE "DISABLED")
|
|
|
|
set(CUPS_FEATURE_TYPE "DISABLED")
|
|
|
|
set(PCSC_FEATURE_TYPE "DISABLED")
|
|
|
|
set(FFMPEG_FEATURE_TYPE "DISABLED")
|
2014-05-24 20:21:40 +04:00
|
|
|
set(GSTREAMER_1_0_FEATURE_TYPE "DISABLED")
|
|
|
|
set(GSTREAMER_0_10_FEATURE_TYPE "DISABLED")
|
2013-09-23 14:39:41 +04:00
|
|
|
set(OPENSLES_FEATURE_TYPE "REQUIRED")
|
2012-11-03 03:27:01 +04:00
|
|
|
endif()
|
|
|
|
|
|
|
|
find_feature(X11 ${X11_FEATURE_TYPE} ${X11_FEATURE_PURPOSE} ${X11_FEATURE_DESCRIPTION})
|
2014-10-13 13:43:16 +04:00
|
|
|
find_feature(Wayland ${WAYLAND_FEATURE_TYPE} ${WAYLAND_FEATURE_PURPOSE} ${WAYLAND_FEATURE_DESCRIPTION})
|
2012-11-03 03:27:01 +04:00
|
|
|
find_feature(DirectFB ${DIRECTFB_FEATURE_TYPE} ${DIRECTFB_FEATURE_PURPOSE} ${DIRECTFB_FEATURE_DESCRIPTION})
|
2013-06-18 14:29:30 +04:00
|
|
|
if (${WITH_DIRECTFB})
|
2014-02-03 07:37:54 +04:00
|
|
|
message(WARNING "DIRECTFB is orphaned and not maintained see docs/README.directfb for details")
|
2013-06-18 14:29:30 +04:00
|
|
|
endif()
|
2012-11-03 03:27:01 +04:00
|
|
|
|
|
|
|
find_feature(ZLIB ${ZLIB_FEATURE_TYPE} ${ZLIB_FEATURE_PURPOSE} ${ZLIB_FEATURE_DESCRIPTION})
|
|
|
|
find_feature(OpenSSL ${OPENSSL_FEATURE_TYPE} ${OPENSSL_FEATURE_PURPOSE} ${OPENSSL_FEATURE_DESCRIPTION})
|
2015-09-16 03:52:46 +03:00
|
|
|
find_feature(MbedTLS ${MBEDTLS_FEATURE_TYPE} ${MBEDTLS_FEATURE_PURPOSE} ${MBEDTLS_FEATURE_DESCRIPTION})
|
2013-09-23 14:39:41 +04:00
|
|
|
find_feature(OpenSLES ${OPENSLES_FEATURE_TYPE} ${OPENSLES_FEATURE_PURPOSE} ${OPENSLES_FEATURE_DESCRIPTION})
|
2012-11-03 03:27:01 +04:00
|
|
|
|
2015-03-09 09:23:29 +03:00
|
|
|
find_feature(OSS ${OSS_FEATURE_TYPE} ${OSS_FEATURE_PURPOSE} ${OSS_FEATURE_DESCRIPTION})
|
2012-11-03 03:27:01 +04:00
|
|
|
find_feature(ALSA ${ALSA_FEATURE_TYPE} ${ALSA_FEATURE_PURPOSE} ${ALSA_FEATURE_DESCRIPTION})
|
|
|
|
find_feature(Pulse ${PULSE_FEATURE_TYPE} ${PULSE_FEATURE_PURPOSE} ${PULSE_FEATURE_DESCRIPTION})
|
|
|
|
|
|
|
|
find_feature(Cups ${CUPS_FEATURE_TYPE} ${CUPS_FEATURE_PURPOSE} ${CUPS_FEATURE_DESCRIPTION})
|
|
|
|
find_feature(PCSC ${PCSC_FEATURE_TYPE} ${PCSC_FEATURE_PURPOSE} ${PCSC_FEATURE_DESCRIPTION})
|
|
|
|
|
|
|
|
find_feature(FFmpeg ${FFMPEG_FEATURE_TYPE} ${FFMPEG_FEATURE_PURPOSE} ${FFMPEG_FEATURE_DESCRIPTION})
|
2014-05-24 20:21:40 +04:00
|
|
|
|
|
|
|
find_feature(GStreamer_0_10 ${GSTREAMER_0_10_FEATURE_TYPE} ${GSTREAMER_0_10_FEATURE_PURPOSE} ${GSTREAMER_0_10_FEATURE_DESCRIPTION})
|
|
|
|
find_feature(GStreamer_1_0 ${GSTREAMER_1_0_FEATURE_TYPE} ${GSTREAMER_1_0_FEATURE_PURPOSE} ${GSTREAMER_1_0_FEATURE_DESCRIPTION})
|
2012-11-03 03:27:01 +04:00
|
|
|
|
2013-08-02 12:04:58 +04:00
|
|
|
find_feature(JPEG ${JPEG_FEATURE_TYPE} ${JPEG_FEATURE_PURPOSE} ${JPEG_FEATURE_DESCRIPTION})
|
2015-07-28 23:01:34 +03:00
|
|
|
find_feature(x264 ${X264_FEATURE_TYPE} ${X264_FEATURE_PURPOSE} ${X264_FEATURE_DESCRIPTION})
|
2014-07-02 07:28:09 +04:00
|
|
|
find_feature(OpenH264 ${OPENH264_FEATURE_TYPE} ${OPENH264_FEATURE_PURPOSE} ${OPENH264_FEATURE_DESCRIPTION})
|
2013-11-22 21:11:39 +04:00
|
|
|
find_feature(GSM ${GSM_FEATURE_TYPE} ${GSM_FEATURE_PURPOSE} ${GSM_FEATURE_DESCRIPTION})
|
2013-08-02 12:04:58 +04:00
|
|
|
|
2013-02-28 14:13:43 +04:00
|
|
|
if(TARGET_ARCH MATCHES "x86|x64")
|
|
|
|
if (NOT APPLE)
|
|
|
|
# Intel Performance Primitives
|
|
|
|
find_feature(IPP ${IPP_FEATURE_TYPE} ${IPP_FEATURE_PURPOSE} ${IPP_FEATURE_DESCRIPTION})
|
|
|
|
endif()
|
|
|
|
endif()
|
2013-01-19 02:32:58 +04:00
|
|
|
|
2015-10-05 23:23:44 +03:00
|
|
|
if(OPENSSL_FOUND)
|
|
|
|
add_definitions("-DWITH_OPENSSL")
|
2016-11-21 19:28:54 +03:00
|
|
|
message(STATUS "Using OpenSSL Version: ${OPENSSL_VERSION}")
|
2015-10-05 23:23:44 +03:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(MBEDTLS_FOUND)
|
|
|
|
add_definitions("-DWITH_MBEDTLS")
|
|
|
|
endif()
|
|
|
|
|
2015-02-05 19:46:56 +03:00
|
|
|
if (TARGET_ARCH MATCHES "sparc")
|
|
|
|
set(HAVE_ALIGNED_REQUIRED 1)
|
|
|
|
endif()
|
|
|
|
|
2016-11-10 12:18:55 +03:00
|
|
|
# Android expects all libraries to be loadable
|
|
|
|
# without paths.
|
|
|
|
if (ANDROID)
|
|
|
|
set(FREERDP_DATA_PATH "share")
|
|
|
|
set(FREERDP_INSTALL_PREFIX ".")
|
|
|
|
set(FREERDP_LIBRARY_PATH ".")
|
|
|
|
set(FREERDP_PLUGIN_PATH ".")
|
|
|
|
set(FREERDP_ADDIN_PATH ".")
|
|
|
|
else (ANDROID)
|
|
|
|
set(FREERDP_DATA_PATH "${CMAKE_INSTALL_PREFIX}/share/freerdp${FREERDP_VERSION_MAJOR}")
|
|
|
|
set(FREERDP_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
|
|
|
set(FREERDP_LIBRARY_PATH "${CMAKE_INSTALL_LIBDIR}")
|
|
|
|
set(FREERDP_PLUGIN_PATH "${CMAKE_INSTALL_LIBDIR}/freerdp${FREERDP_VERSION_MAJOR}")
|
|
|
|
set(FREERDP_ADDIN_PATH "${FREERDP_PLUGIN_PATH}")
|
|
|
|
endif(ANDROID)
|
2011-07-08 10:28:52 +04:00
|
|
|
|
2012-07-03 11:51:00 +04:00
|
|
|
# Path to put extensions
|
2016-03-03 13:36:26 +03:00
|
|
|
set(FREERDP_EXTENSION_PATH "${CMAKE_INSTALL_FULL_LIBDIR}/freerdp${FREERDP_VERSION_MAJOR}/extensions")
|
2012-07-03 11:51:00 +04:00
|
|
|
|
2011-07-04 11:41:53 +04:00
|
|
|
# Include directories
|
2013-08-12 14:53:04 +04:00
|
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
2013-11-06 20:29:33 +04:00
|
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
|
2012-08-15 04:21:00 +04:00
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
|
2011-07-04 11:41:53 +04:00
|
|
|
|
2011-07-04 07:40:26 +04:00
|
|
|
# Configure files
|
2012-08-15 01:09:01 +04:00
|
|
|
add_definitions("-DHAVE_CONFIG_H")
|
2013-08-12 14:53:04 +04:00
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
2011-07-04 07:40:26 +04:00
|
|
|
|
2012-10-14 20:58:09 +04:00
|
|
|
# RPATH configuration
|
2014-04-16 11:53:02 +04:00
|
|
|
if(CMAKE_SKIP_RPATH)
|
2016-02-01 17:21:07 +03:00
|
|
|
set(CMAKE_SKIP_RPATH FALSE)
|
|
|
|
set(CMAKE_SKIP_INSTALL_RPATH TRUE)
|
2014-04-16 11:53:02 +04:00
|
|
|
endif()
|
2012-10-16 01:13:54 +04:00
|
|
|
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
|
|
|
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
|
|
|
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
2012-11-06 04:55:15 +04:00
|
|
|
set(CMAKE_INSTALL_RPATH "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:\$ORIGIN/..")
|
2012-10-14 20:58:09 +04:00
|
|
|
|
2013-09-18 14:50:10 +04:00
|
|
|
# Android profiling
|
|
|
|
if(ANDROID)
|
2013-09-18 15:12:52 +04:00
|
|
|
if(WITH_GPROF)
|
2013-09-18 14:50:10 +04:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pg")
|
|
|
|
set(PROFILER_LIBRARIES
|
2013-11-21 12:45:35 +04:00
|
|
|
"${FREERDP_EXTERNAL_PROFILER_PATH}/obj/local/${ANDROID_ABI}/libandroid-ndk-profiler.a")
|
|
|
|
include_directories("${FREERDP_EXTERNAL_PROFILER_PATH}")
|
2013-09-18 14:50:10 +04:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2012-10-01 04:15:42 +04:00
|
|
|
# Unit Tests
|
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
include(CTest)
|
2012-10-01 04:15:42 +04:00
|
|
|
|
2015-02-23 18:48:07 +03:00
|
|
|
if(BUILD_TESTING)
|
2016-10-11 12:13:54 +03:00
|
|
|
enable_testing()
|
2015-02-23 18:48:07 +03:00
|
|
|
|
2012-10-19 05:11:12 +04:00
|
|
|
if(MSVC)
|
|
|
|
set(TESTING_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
|
|
|
|
else()
|
|
|
|
set(TESTING_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Testing")
|
|
|
|
endif()
|
2012-10-01 04:15:42 +04:00
|
|
|
endif()
|
|
|
|
|
2012-09-21 04:45:56 +04:00
|
|
|
# WinPR
|
2013-08-12 15:51:18 +04:00
|
|
|
include_directories("${CMAKE_SOURCE_DIR}/winpr/include")
|
|
|
|
include_directories("${CMAKE_BINARY_DIR}/winpr/include")
|
2012-09-21 04:45:56 +04:00
|
|
|
|
2016-03-25 18:28:17 +03:00
|
|
|
if (${CMAKE_VERSION} VERSION_LESS 2.8.12)
|
|
|
|
set(PUBLIC_KEYWORD "")
|
|
|
|
set(PRIVATE_KEYWORD "")
|
|
|
|
else()
|
|
|
|
set(PUBLIC_KEYWORD "PUBLIC")
|
|
|
|
set(PRIVATE_KEYWORD "PRIVATE")
|
|
|
|
endif()
|
|
|
|
|
2012-09-21 04:45:56 +04:00
|
|
|
add_subdirectory(winpr)
|
|
|
|
|
2011-07-04 07:40:26 +04:00
|
|
|
# Sub-directories
|
2012-08-14 07:19:51 +04:00
|
|
|
|
2013-04-04 14:28:52 +04:00
|
|
|
if(WITH_THIRD_PARTY)
|
|
|
|
add_subdirectory(third-party)
|
|
|
|
if (NOT "${THIRD_PARTY_INCLUDES}" STREQUAL "")
|
|
|
|
include_directories(${THIRD_PARTY_INCLUDES})
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2013-09-04 04:37:04 +04:00
|
|
|
add_subdirectory(include)
|
2012-05-22 00:01:24 +04:00
|
|
|
|
2012-08-14 07:19:51 +04:00
|
|
|
add_subdirectory(libfreerdp)
|
2011-08-17 07:54:42 +04:00
|
|
|
|
2013-03-29 17:28:27 +04:00
|
|
|
if (IOS)
|
2013-04-30 03:53:56 +04:00
|
|
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "")
|
2013-10-05 23:47:03 +04:00
|
|
|
if (IOS_PLATFORM MATCHES "SIMULATOR")
|
|
|
|
set(CMAKE_OSX_SYSROOT "iphonesimulator")
|
|
|
|
else()
|
|
|
|
set(CMAKE_OSX_SYSROOT "iphoneos")
|
|
|
|
endif()
|
2013-03-29 17:28:27 +04:00
|
|
|
endif()
|
2013-04-30 03:53:56 +04:00
|
|
|
|
2014-09-30 00:08:08 +04:00
|
|
|
# RdTk
|
|
|
|
include_directories("${CMAKE_SOURCE_DIR}/rdtk/include")
|
|
|
|
include_directories("${CMAKE_BINARY_DIR}/rdtk/include")
|
|
|
|
|
|
|
|
add_subdirectory(rdtk)
|
|
|
|
|
2016-01-18 17:55:33 +03:00
|
|
|
if(WAYLAND_FOUND)
|
2016-10-11 12:13:54 +03:00
|
|
|
add_subdirectory(uwac)
|
2016-01-18 17:55:33 +03:00
|
|
|
endif()
|
|
|
|
|
2015-03-28 03:08:36 +03:00
|
|
|
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()
|
|
|
|
|
|
|
|
if(WITH_CHANNELS)
|
|
|
|
add_subdirectory(channels)
|
|
|
|
endif()
|
|
|
|
|
2015-11-04 11:53:13 +03:00
|
|
|
if(WITH_CLIENT_COMMON OR WITH_CLIENT)
|
|
|
|
add_subdirectory(client)
|
2012-01-22 21:14:06 +04:00
|
|
|
endif()
|
|
|
|
|
2012-01-22 21:26:30 +04:00
|
|
|
if(WITH_SERVER)
|
2012-01-22 21:14:06 +04:00
|
|
|
add_subdirectory(server)
|
2013-10-29 22:47:40 +04:00
|
|
|
endif()
|
2013-10-29 06:09:31 +04:00
|
|
|
|
2012-10-17 05:57:43 +04:00
|
|
|
# Packaging
|
|
|
|
|
2013-09-10 06:25:47 +04:00
|
|
|
set(CMAKE_CPACK_INCLUDE_FILE "CMakeCPack.cmake")
|
2013-01-31 03:54:08 +04:00
|
|
|
|
2013-09-10 06:25:47 +04:00
|
|
|
if(NOT (VENDOR MATCHES "FreeRDP"))
|
|
|
|
if(DEFINED CLIENT_VENDOR_PATH)
|
2013-09-10 22:46:48 +04:00
|
|
|
if(EXISTS "${CMAKE_SOURCE_DIR}/${CLIENT_VENDOR_PATH}/CMakeCPack.cmake")
|
2013-09-10 06:25:47 +04:00
|
|
|
set(CMAKE_CPACK_INCLUDE_FILE "${CLIENT_VENDOR_PATH}/CMakeCPack.cmake")
|
2013-09-04 04:37:04 +04:00
|
|
|
endif()
|
2012-11-12 22:17:44 +04:00
|
|
|
endif()
|
2013-01-29 15:59:58 +04:00
|
|
|
endif()
|
|
|
|
|
2013-09-10 22:46:48 +04:00
|
|
|
#message("VENDOR: ${VENDOR} CLIENT_VENDOR_PATH: ${CLIENT_VENDOR_PATH} CMAKE_CPACK_INCLUDE_FILE: ${CMAKE_CPACK_INCLUDE_FILE}")
|
|
|
|
|
2013-09-10 06:25:47 +04:00
|
|
|
include(${CMAKE_CPACK_INCLUDE_FILE})
|
2014-04-23 15:12:23 +04:00
|
|
|
|
2016-01-11 18:18:40 +03:00
|
|
|
set(FREERDP_BUILD_CONFIG_LIST "")
|
|
|
|
GET_CMAKE_PROPERTY(res VARIABLES)
|
|
|
|
FOREACH(var ${res})
|
2016-10-11 12:13:54 +03:00
|
|
|
IF (var MATCHES "^WITH_*|^BUILD_TESTING|^BUILTIN_CHANNELS|^HAVE_*")
|
|
|
|
LIST(APPEND FREERDP_BUILD_CONFIG_LIST "${var}=${${var}}")
|
|
|
|
ENDIF()
|
2016-01-11 18:18:40 +03:00
|
|
|
ENDFOREACH()
|
|
|
|
string(REPLACE ";" " " FREERDP_BUILD_CONFIG "${FREERDP_BUILD_CONFIG_LIST}")
|
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/buildflags.h.in ${CMAKE_CURRENT_BINARY_DIR}/buildflags.h)
|