2012-10-09 11:02:04 +08:00
|
|
|
# FreeRDP: A Remote Desktop Protocol Implementation
|
2011-07-03 01:58:55 +08: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-14 03:45:58 +08:00
|
|
|
# Copyright 2012 HP Development Company, LLC
|
2011-07-03 01:58:55 +08: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 21:42:23 +08:00
|
|
|
cmake_minimum_required(VERSION 2.8)
|
|
|
|
|
2011-07-01 08:31:07 +08:00
|
|
|
project(FreeRDP C)
|
2012-10-04 21:42:23 +08:00
|
|
|
|
2013-09-10 10:25:47 +08:00
|
|
|
if(NOT DEFINED VENDOR)
|
|
|
|
set(VENDOR "FreeRDP" CACHE STRING "FreeRDP package vendor")
|
|
|
|
endif()
|
|
|
|
|
2011-07-01 08:31:07 +08:00
|
|
|
set(CMAKE_COLOR_MAKEFILE ON)
|
|
|
|
|
2013-09-04 09:48:26 +08:00
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
|
2012-11-23 22:12:52 +08:00
|
|
|
# Include our extra modules
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/)
|
|
|
|
|
|
|
|
# Check for cmake compatibility (enable/disable features)
|
|
|
|
include(CheckCmakeCompat)
|
|
|
|
|
2011-07-04 11:40:26 +08:00
|
|
|
# Include cmake modules
|
|
|
|
include(CheckIncludeFiles)
|
|
|
|
include(CheckLibraryExists)
|
2012-02-16 05:28:47 +08:00
|
|
|
include(CheckStructHasMember)
|
2012-10-13 04:37:45 +08:00
|
|
|
include(CMakeDetermineSystem)
|
2011-08-15 18:21:58 +08:00
|
|
|
include(FindPkgConfig)
|
2011-07-04 11:40:26 +08:00
|
|
|
include(TestBigEndian)
|
|
|
|
|
2012-11-03 07:27:01 +08:00
|
|
|
include(FindFeature)
|
2011-07-03 03:44:40 +08:00
|
|
|
include(AutoVersioning)
|
2011-07-04 17:01:06 +08:00
|
|
|
include(ConfigOptions)
|
2012-10-14 03:20:39 +08:00
|
|
|
include(ComplexLibrary)
|
2012-11-03 07:27:01 +08:00
|
|
|
include(FeatureSummary)
|
2011-09-20 11:02:07 +08:00
|
|
|
include(CheckCCompilerFlag)
|
2011-12-06 13:02:07 +08:00
|
|
|
include(GNUInstallDirsWrapper)
|
2013-10-29 10:09:31 +08:00
|
|
|
include(CMakePackageConfigHelpers)
|
2011-07-03 03:44:40 +08:00
|
|
|
|
2012-01-15 02:33:04 +08:00
|
|
|
# Soname versioning
|
2011-11-11 04:46:46 +08:00
|
|
|
set(FREERDP_VERSION_MAJOR "1")
|
2013-12-09 22:56:13 +08:00
|
|
|
set(FREERDP_VERSION_MINOR "2")
|
2012-09-21 08:45:56 +08:00
|
|
|
set(FREERDP_VERSION_REVISION "0")
|
2013-03-13 03:59:04 +08:00
|
|
|
set(FREERDP_VERSION_SUFFIX "beta1")
|
2012-11-19 00:07:33 +08:00
|
|
|
set(FREERDP_API_VERSION "${FREERDP_VERSION_MAJOR}.${FREERDP_VERSION_MINOR}")
|
|
|
|
set(FREERDP_VERSION "${FREERDP_API_VERSION}.${FREERDP_VERSION_REVISION}")
|
2012-11-14 19:32:33 +08:00
|
|
|
if (FREERDP_VERSION_SUFFIX)
|
2012-11-19 00:07:33 +08:00
|
|
|
set(FREERDP_VERSION_FULL "${FREERDP_VERSION}-${FREERDP_VERSION_SUFFIX}")
|
2012-11-14 19:32:33 +08:00
|
|
|
else()
|
2012-11-19 00:07:33 +08:00
|
|
|
set(FREERDP_VERSION_FULL "${FREERDP_VERSION}")
|
2012-11-14 19:32:33 +08:00
|
|
|
endif()
|
2013-01-29 19:59:58 +08:00
|
|
|
|
|
|
|
# Allow to search the host machine for git
|
2013-02-14 21:59:12 +08:00
|
|
|
if(ANDROID OR IOS)
|
2013-11-19 02:58:01 +08:00
|
|
|
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
|
2013-02-14 21:59:12 +08:00
|
|
|
endif(ANDROID OR IOS)
|
2012-07-27 09:08:30 +08:00
|
|
|
include(GetGitRevisionDescription)
|
2013-02-14 21:59:12 +08:00
|
|
|
if(ANDROID OR IOS)
|
2013-11-19 02:58:01 +08:00
|
|
|
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
|
2013-02-14 21:59:12 +08:00
|
|
|
endif(ANDROID OR IOS)
|
2013-01-29 19:59:58 +08:00
|
|
|
|
2012-07-27 09:08:30 +08:00
|
|
|
git_describe(GIT_REVISION --match "[0-9]*" --abbrev=4 --tags --always)
|
|
|
|
message(STATUS "Git Revision ${GIT_REVISION}")
|
2011-07-01 08:31:07 +08:00
|
|
|
|
2012-10-01 10:58:59 +08:00
|
|
|
# Turn on solution folders (2.8.4+)
|
|
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
|
|
|
|
2011-07-01 08:31:07 +08:00
|
|
|
# Default to release build type
|
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
2013-04-30 07:53:56 +08:00
|
|
|
set(CMAKE_BUILD_TYPE "Release")
|
2013-03-19 10:29:52 +08:00
|
|
|
endif()
|
|
|
|
|
2012-03-22 03:46:37 +08:00
|
|
|
if(NOT DEFINED BUILD_SHARED_LIBS)
|
2013-06-12 02:56:43 +08:00
|
|
|
if(ANDROID OR IOS OR APPLE)
|
2012-10-23 07:01:19 +08:00
|
|
|
set(BUILD_SHARED_LIBS OFF)
|
|
|
|
else()
|
|
|
|
set(BUILD_SHARED_LIBS ON)
|
|
|
|
endif()
|
2011-09-01 22:18:58 +08:00
|
|
|
endif()
|
|
|
|
|
2012-10-19 10:05:06 +08:00
|
|
|
if(NOT DEFINED EXPORT_ALL_SYMBOLS)
|
2012-11-18 11:03:04 +08:00
|
|
|
set(EXPORT_ALL_SYMBOLS TRUE)
|
2012-10-19 10:05:06 +08:00
|
|
|
endif()
|
|
|
|
|
2012-09-22 07:28:47 +08:00
|
|
|
# Configure MSVC Runtime
|
|
|
|
if(MSVC)
|
|
|
|
include(MSVCRuntime)
|
|
|
|
if(NOT DEFINED MSVC_RUNTIME)
|
|
|
|
set(MSVC_RUNTIME "dynamic")
|
|
|
|
endif()
|
2012-09-23 05:10:08 +08:00
|
|
|
if(${MSVC_RUNTIME} STREQUAL "static")
|
|
|
|
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 07:28:47 +08:00
|
|
|
configure_msvc_runtime()
|
2013-04-11 09:15:38 +08:00
|
|
|
|
|
|
|
if(NOT DEFINED CMAKE_SUPPRESS_REGENERATION)
|
|
|
|
set(CMAKE_SUPPRESS_REGENERATION ON)
|
|
|
|
endif()
|
2012-09-22 07:28:47 +08:00
|
|
|
endif()
|
|
|
|
|
2011-08-11 15:03:08 +08:00
|
|
|
# Compiler-specific flags
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCC)
|
2013-01-25 21:27:47 +08:00
|
|
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "i686")
|
2013-04-30 04:37:11 +08:00
|
|
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
|
|
|
else()
|
2013-01-25 21:27:47 +08:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i686")
|
|
|
|
endif()
|
2013-09-20 00:08:20 +08: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 22:11:04 +08:00
|
|
|
endif()
|
2013-09-20 00:08:20 +08:00
|
|
|
|
2011-09-20 11:02:07 +08:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
|
2011-10-05 06:47:21 +08: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 11:02:07 +08: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 14:14:19 +08: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")
|
2013-12-06 01:12:55 +08:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
|
2012-10-17 14:14:19 +08:00
|
|
|
endif()
|
2012-10-19 10:05:06 +08: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-19 03:37:00 +08: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()
|
2011-08-25 10:53:06 +08:00
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
2013-07-25 03:36:15 +08:00
|
|
|
set(CMAKE_C_FLAGS_RELEASE "-DNDEBUG")
|
2011-08-11 15:03:08 +08:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
|
2013-06-14 04:18:19 +08:00
|
|
|
else()
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
|
2011-08-11 15:03:08 +08:00
|
|
|
endif()
|
2012-10-13 05:55:12 +08:00
|
|
|
if(WITH_SSE2)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2")
|
|
|
|
endif()
|
2011-08-11 15:03:08 +08:00
|
|
|
endif()
|
|
|
|
|
2013-08-30 20:18:49 +08:00
|
|
|
if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
|
2013-10-25 21:48:02 +08:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter")
|
2013-08-30 20:18:49 +08: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-06-01 01:51:50 +08:00
|
|
|
if(WITH_SSE2)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mssse3")
|
|
|
|
endif()
|
2013-09-11 02:03:15 +08: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")
|
2013-12-06 01:12:55 +08:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
|
2013-09-11 02:03:15 +08:00
|
|
|
endif()
|
2013-06-01 01:51:50 +08:00
|
|
|
endif()
|
|
|
|
|
2011-08-17 02:41:12 +08:00
|
|
|
if(MSVC)
|
2012-09-03 22:47:45 +08:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Gd")
|
2014-02-10 13:34:17 +08:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3")
|
|
|
|
|
2012-08-08 08:48:29 +08:00
|
|
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_AMD64_")
|
|
|
|
else()
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_X86_")
|
|
|
|
endif()
|
2014-02-10 13:34:17 +08:00
|
|
|
|
|
|
|
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
|
|
|
|
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
|
2013-07-25 03:36:15 +08: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()
|
|
|
|
|
2011-08-17 02:41:12 +08:00
|
|
|
endif()
|
|
|
|
|
2013-04-09 11:08:16 +08:00
|
|
|
if(WIN32)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUNICODE -D_UNICODE")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_WIN32_WINNT=0x0501")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
|
2013-09-24 07:41:18 +08:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWIN32_LEAN_AND_MEAN")
|
2013-04-09 11:08:16 +08:00
|
|
|
endif()
|
|
|
|
|
2013-02-14 21:59:12 +08:00
|
|
|
if(IOS)
|
2013-03-29 21:28:27 +08:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -isysroot ${CMAKE_IOS_SDK_ROOT} -g")
|
2013-02-14 21:59:12 +08:00
|
|
|
endif()
|
|
|
|
|
2012-10-30 03:02:35 +08:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DFREERDP_EXPORTS")
|
2014-02-03 11:37:54 +08:00
|
|
|
|
2011-07-04 11:40:26 +08:00
|
|
|
# Include files
|
2013-03-29 21:28:27 +08:00
|
|
|
if(NOT IOS)
|
2014-02-03 11:37:54 +08:00
|
|
|
check_include_files(fcntl.h HAVE_FCNTL_H)
|
|
|
|
check_include_files(unistd.h HAVE_UNISTD_H)
|
|
|
|
check_include_files(stdint.h HAVE_STDINT_H)
|
|
|
|
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)
|
|
|
|
check_include_files(sys/strtio.h HAVE_SYS_STRTIO_H)
|
|
|
|
check_include_files(sys/select.h HAVE_SYS_SELECT_H)
|
2013-03-29 21:28:27 +08:00
|
|
|
else()
|
2014-02-03 11:37:54 +08:00
|
|
|
set(HAVE_FCNTL_H 1)
|
|
|
|
set(HAVE_UNISTD_H 1)
|
|
|
|
set(HAVE_STDINT_H 1)
|
|
|
|
set(HAVE_INTTYPES_H 1)
|
|
|
|
set(HAVE_SYS_FILIO_H 1)
|
2013-03-29 21:28:27 +08:00
|
|
|
endif()
|
2011-07-04 11:40:26 +08:00
|
|
|
|
2013-03-29 21:28:27 +08:00
|
|
|
if(NOT IOS)
|
2014-02-03 11:37:54 +08:00
|
|
|
check_struct_has_member("struct tm" tm_gmtoff time.h HAVE_TM_GMTOFF)
|
2013-03-29 21:28:27 +08:00
|
|
|
else()
|
2014-02-03 11:37:54 +08:00
|
|
|
set(HAVE_TM_GMTOFF 1)
|
2013-03-29 21:28:27 +08:00
|
|
|
endif()
|
2012-02-16 05:28:47 +08:00
|
|
|
|
2011-11-16 12:21:53 +08:00
|
|
|
# Mac OS X
|
|
|
|
if(APPLE)
|
2013-09-24 07:41:18 +08: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 09:23:08 +08:00
|
|
|
if(NOT DEFINED CMAKE_OSX_ARCHITECTURES)
|
|
|
|
set(CMAKE_OSX_ARCHITECTURES i386 x86_64)
|
|
|
|
endif()
|
|
|
|
|
2013-09-24 07:41:18 +08:00
|
|
|
if(IS_DIRECTORY /opt/local/include)
|
|
|
|
include_directories(/opt/local/include)
|
|
|
|
link_directories(/opt/local/lib)
|
|
|
|
endif()
|
|
|
|
endif(IOS)
|
2013-08-09 04:10:23 +08:00
|
|
|
|
2013-09-11 22:36:38 +08:00
|
|
|
# Temporarily disabled, causes the cmake script to be reexecuted, causing the compilation to fail.
|
|
|
|
# Workaround: specify the parameter in the command-line
|
|
|
|
# if(WITH_CLANG)
|
|
|
|
# set(CMAKE_C_COMPILER "clang")
|
|
|
|
# endif()
|
2013-06-12 02:56:43 +08:00
|
|
|
|
2013-09-24 07:41:18 +08: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 12:21:53 +08:00
|
|
|
|
2013-01-29 19:59:58 +08:00
|
|
|
# Android
|
|
|
|
if(ANDROID)
|
2013-09-23 18:39:41 +08:00
|
|
|
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
|
|
|
add_definitions(-DNDK_DEBUG=1)
|
2013-11-08 23:32:50 +08: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 18:39:41 +08:00
|
|
|
endif()
|
2013-09-23 23:48:02 +08:00
|
|
|
set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -llog")
|
2013-01-29 19:59:58 +08:00
|
|
|
if (NOT FREERDP_ANDROID_EXTERNAL_SSL_PATH)
|
2013-03-24 06:13:10 +08:00
|
|
|
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/external/openssl")
|
|
|
|
set(FREERDP_ANDROID_EXTERNAL_SSL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external/openssl")
|
|
|
|
else()
|
|
|
|
message(STATUS "FREERDP_ANDROID_EXTERNAL_SSL_PATH not set! - Needs to be set if openssl is not found in the android NDK (which usually isn't)")
|
|
|
|
endif()
|
2013-09-18 19:12:52 +08:00
|
|
|
if(WITH_GPROF)
|
2013-09-18 18:50:10 +08:00
|
|
|
if (NOT FREERDP_ANDROID_EXTERNAL_PROFILER_PATH)
|
|
|
|
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/external/android-ndk-profiler")
|
|
|
|
set(FREERDP_ANDROID_EXTERNAL_PROFILER_PATH
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/external/android-ndk-profiler")
|
|
|
|
else()
|
|
|
|
message(STATUS "FREERDP_ANDROID_EXTERNAL_PROFILER_PATH not set!")
|
|
|
|
endif()
|
|
|
|
endif()
|
2013-01-29 19:59:58 +08:00
|
|
|
endif()
|
2013-09-18 18:50:10 +08:00
|
|
|
endif()
|
2013-01-29 19:59:58 +08:00
|
|
|
set(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH} ${FREERDP_ANDROID_EXTERNAL_SSL_PATH})
|
2013-11-08 19:48:04 +08:00
|
|
|
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/client/Android/FreeRDPCore/jni/${ANDROID_ABI})
|
2013-11-12 17:21:14 +08:00
|
|
|
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/scripts/regenerate_jni_headers.sh.cmake
|
|
|
|
${CMAKE_BINARY_DIR}/scripts/regenerate_jni_headers.sh @ONLY)
|
2013-11-18 19:50:32 +08:00
|
|
|
if (WITH_GPROF)
|
|
|
|
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/scripts/gprof_generate.sh.cmake ${CMAKE_BINARY_DIR}/scripts/gprof_generate.sh @ONLY)
|
|
|
|
endif(WITH_GPROF)
|
2013-11-12 17:21:14 +08:00
|
|
|
|
2013-01-29 19:59:58 +08:00
|
|
|
endif()
|
|
|
|
|
2012-11-03 07:27:01 +08:00
|
|
|
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
2013-04-30 07:53:56 +08:00
|
|
|
|
2013-03-29 21:28:27 +08:00
|
|
|
if(NOT IOS AND NOT ANDROID)
|
2012-12-20 20:13:36 +08:00
|
|
|
find_package(Threads REQUIRED)
|
2012-12-20 20:09:33 +08:00
|
|
|
endif()
|
2012-11-03 07:27:01 +08:00
|
|
|
|
2014-02-03 11:37:54 +08:00
|
|
|
if(NOT WIN32)
|
|
|
|
list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
|
|
|
|
check_library_exists(pthread pthread_tryjoin_np "" HAVE_PTHREAD_GNU_EXT)
|
|
|
|
list(REMOVE_ITEM CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
|
|
|
|
endif()
|
2013-11-15 23:04:04 +08:00
|
|
|
|
2012-11-03 07:27:01 +08:00
|
|
|
if(UNIX OR CYGWIN)
|
2013-08-23 10:36:37 +08:00
|
|
|
check_include_files(sys/eventfd.h HAVE_AIO_H)
|
2013-01-24 04:59:01 +08:00
|
|
|
check_include_files(sys/eventfd.h HAVE_EVENTFD_H)
|
2013-08-04 07:50:17 +08:00
|
|
|
check_include_files(sys/timerfd.h HAVE_TIMERFD_H)
|
2012-11-03 07:27:01 +08:00
|
|
|
set(X11_FEATURE_TYPE "RECOMMENDED")
|
|
|
|
else()
|
|
|
|
set(X11_FEATURE_TYPE "DISABLED")
|
2012-10-14 08:31:01 +08:00
|
|
|
endif()
|
|
|
|
|
2012-11-03 07:27:01 +08:00
|
|
|
set(X11_FEATURE_PURPOSE "X11")
|
|
|
|
set(X11_FEATURE_DESCRIPTION "X11 client and server")
|
2012-10-14 08:31:01 +08:00
|
|
|
|
2012-11-03 07:27:01 +08:00
|
|
|
set(DIRECTFB_FEATURE_TYPE "OPTIONAL")
|
|
|
|
set(DIRECTFB_FEATURE_PURPOSE "DirectFB")
|
|
|
|
set(DIRECTFB_FEATURE_DESCRIPTION "DirectFB client")
|
2011-11-16 12:21:53 +08:00
|
|
|
|
2012-11-03 07:27:01 +08:00
|
|
|
set(ZLIB_FEATURE_TYPE "REQUIRED")
|
|
|
|
set(ZLIB_FEATURE_PURPOSE "compression")
|
|
|
|
set(ZLIB_FEATURE_DESCRIPTION "data compression")
|
2012-10-14 08:31:01 +08:00
|
|
|
|
2012-11-03 07:27:01 +08:00
|
|
|
set(OPENSSL_FEATURE_TYPE "REQUIRED")
|
|
|
|
set(OPENSSL_FEATURE_PURPOSE "cryptography")
|
|
|
|
set(OPENSSL_FEATURE_DESCRIPTION "encryption, certificate validation, hashing functions")
|
|
|
|
|
2013-09-23 18:39:41 +08:00
|
|
|
set(OPENSLES_FEATURE_TYPE "OPTIONAL")
|
|
|
|
set(OPENSLES_FEATURE_PURPOSE "multimedia")
|
|
|
|
set(OPENSLES_FEATURE_DESCRIPTION "OpenSLES audio / video")
|
|
|
|
|
2012-11-03 07:27:01 +08: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")
|
|
|
|
|
|
|
|
set(GSTREAMER_FEATURE_TYPE "RECOMMENDED")
|
|
|
|
set(GSTREAMER_FEATURE_PURPOSE "multimedia")
|
|
|
|
set(GSTREAMER_FEATURE_DESCRIPTION "multimedia redirection, audio and video playback")
|
|
|
|
|
2013-01-19 06:32:58 +08:00
|
|
|
set(IPP_FEATURE_TYPE "OPTIONAL")
|
|
|
|
set(IPP_FEATURE_PURPOSE "performance")
|
|
|
|
set(IPP_FEATURE_DESCRIPTION "Intel Integrated Performance Primitives library")
|
|
|
|
|
2013-05-28 13:14:20 +08:00
|
|
|
set(NPP_FEATURE_TYPE "OPTIONAL")
|
|
|
|
set(NPP_FEATURE_PURPOSE "performance")
|
|
|
|
set(NPP_FEATURE_DESCRIPTION "NVIDIA Performance Primitives library")
|
|
|
|
|
2013-08-02 16:04:58 +08:00
|
|
|
set(JPEG_FEATURE_TYPE "OPTIONAL")
|
|
|
|
set(JPEG_FEATURE_PURPOSE "codec")
|
|
|
|
set(JPEG_FEATURE_DESCRIPTION "use JPEG library")
|
|
|
|
|
2013-11-23 01:11:39 +08:00
|
|
|
set(GSM_FEATURE_TYPE "OPTIONAL")
|
|
|
|
set(GSM_FEATURE_PURPOSE "codec")
|
|
|
|
set(GSM_FEATURE_DESCRIPTION "GSM audio codec library")
|
|
|
|
|
2012-11-03 07:27:01 +08:00
|
|
|
if(WIN32)
|
|
|
|
set(X11_FEATURE_TYPE "DISABLED")
|
2012-11-12 06:23:57 +08:00
|
|
|
set(ZLIB_FEATURE_TYPE "DISABLED")
|
2012-11-03 07:27:01 +08:00
|
|
|
set(DIRECTFB_FEATURE_TYPE "DISABLED")
|
|
|
|
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")
|
|
|
|
set(GSTREAMER_FEATURE_TYPE "DISABLED")
|
2013-09-23 18:39:41 +08:00
|
|
|
set(OPENSLES_FEATURE_TYPE "DISABLED")
|
2011-08-16 05:05:48 +08:00
|
|
|
endif()
|
2011-07-31 09:22:09 +08:00
|
|
|
|
2012-11-03 07:27:01 +08:00
|
|
|
if(APPLE)
|
|
|
|
set(DIRECTFB_FEATURE_TYPE "DISABLED")
|
|
|
|
set(FFMPEG_FEATURE_TYPE "OPTIONAL")
|
2013-04-03 06:13:44 +08:00
|
|
|
set(GSTREAMER_FEATURE_TYPE "OPTIONAL")
|
2013-06-17 17:14:25 +08:00
|
|
|
set(X11_FEATURE_TYPE "OPTIONAL")
|
2013-02-14 21:59:12 +08:00
|
|
|
if(IOS)
|
2013-06-17 17:14:25 +08:00
|
|
|
set(X11_FEATURE_TYPE "DISABLED")
|
2013-02-14 21:59:12 +08:00
|
|
|
set(ALSA_FEATURE_TYPE "DISABLED")
|
|
|
|
set(PULSE_FEATURE_TYPE "DISABLED")
|
|
|
|
set(CUPS_FEATURE_TYPE "DISABLED")
|
|
|
|
set(PCSC_FEATURE_TYPE "DISABLED")
|
|
|
|
set(GSTREAMER_FEATURE_TYPE "DISABLED")
|
|
|
|
endif()
|
2013-09-23 18:39:41 +08:00
|
|
|
set(OPENSLES_FEATURE_TYPE "DISABLED")
|
2012-11-03 07:27:01 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ANDROID)
|
|
|
|
set(X11_FEATURE_TYPE "DISABLED")
|
|
|
|
set(DIRECTFB_FEATURE_TYPE "DISABLED")
|
|
|
|
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")
|
|
|
|
set(GSTREAMER_FEATURE_TYPE "DISABLED")
|
2013-09-23 18:39:41 +08:00
|
|
|
set(OPENSLES_FEATURE_TYPE "REQUIRED")
|
2012-11-03 07:27:01 +08:00
|
|
|
endif()
|
|
|
|
|
2013-02-28 18:13:43 +08:00
|
|
|
|
2012-11-03 07:27:01 +08:00
|
|
|
find_feature(X11 ${X11_FEATURE_TYPE} ${X11_FEATURE_PURPOSE} ${X11_FEATURE_DESCRIPTION})
|
|
|
|
find_feature(DirectFB ${DIRECTFB_FEATURE_TYPE} ${DIRECTFB_FEATURE_PURPOSE} ${DIRECTFB_FEATURE_DESCRIPTION})
|
2013-06-18 18:29:30 +08:00
|
|
|
if (${WITH_DIRECTFB})
|
2014-02-03 11:37:54 +08:00
|
|
|
message(WARNING "DIRECTFB is orphaned and not maintained see docs/README.directfb for details")
|
2013-06-18 18:29:30 +08:00
|
|
|
endif()
|
2012-11-03 07:27:01 +08: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})
|
2013-09-23 18:39:41 +08:00
|
|
|
find_feature(OpenSLES ${OPENSLES_FEATURE_TYPE} ${OPENSLES_FEATURE_PURPOSE} ${OPENSLES_FEATURE_DESCRIPTION})
|
2012-11-03 07:27:01 +08: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})
|
|
|
|
find_feature(Gstreamer ${GSTREAMER_FEATURE_TYPE} ${GSTREAMER_FEATURE_PURPOSE} ${GSTREAMER_FEATURE_DESCRIPTION})
|
|
|
|
|
2013-08-02 16:04:58 +08:00
|
|
|
find_feature(JPEG ${JPEG_FEATURE_TYPE} ${JPEG_FEATURE_PURPOSE} ${JPEG_FEATURE_DESCRIPTION})
|
2013-11-23 01:11:39 +08:00
|
|
|
find_feature(GSM ${GSM_FEATURE_TYPE} ${GSM_FEATURE_PURPOSE} ${GSM_FEATURE_DESCRIPTION})
|
2013-08-02 16:04:58 +08:00
|
|
|
|
2013-02-28 18:13:43 +08: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()
|
2013-05-28 13:14:20 +08:00
|
|
|
find_feature(NPP ${NPP_FEATURE_TYPE} ${NPP_FEATURE_PURPOSE} ${NPP_FEATURE_DESCRIPTION})
|
2013-02-28 18:13:43 +08:00
|
|
|
endif()
|
2013-01-19 06:32:58 +08:00
|
|
|
|
2012-02-19 11:04:28 +08:00
|
|
|
# Path to put FreeRDP data
|
|
|
|
set(FREERDP_DATA_PATH "${CMAKE_INSTALL_PREFIX}/share/freerdp")
|
2011-07-01 08:31:07 +08:00
|
|
|
|
2011-07-08 14:28:52 +08:00
|
|
|
# Path to put plugins
|
2012-10-17 14:14:19 +08:00
|
|
|
|
2012-11-18 11:03:04 +08:00
|
|
|
set(FREERDP_LIBRARY_PATH "${CMAKE_INSTALL_LIBDIR}")
|
|
|
|
|
2012-11-13 02:17:44 +08:00
|
|
|
set(FREERDP_PLUGIN_PATH "${CMAKE_INSTALL_LIBDIR}/freerdp")
|
2012-11-04 11:04:04 +08:00
|
|
|
set(FREERDP_ADDIN_PATH "${FREERDP_PLUGIN_PATH}")
|
2011-07-08 14:28:52 +08:00
|
|
|
|
2012-07-03 15:51:00 +08:00
|
|
|
# Path to put extensions
|
2012-08-15 12:26:04 +08:00
|
|
|
set(FREERDP_EXTENSION_PATH "${CMAKE_INSTALL_FULL_LIBDIR}/freerdp/extensions")
|
2012-07-03 15:51:00 +08:00
|
|
|
|
2011-07-04 15:41:53 +08:00
|
|
|
# Include directories
|
2013-08-12 18:53:04 +08:00
|
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
2013-11-07 00:29:33 +08:00
|
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
|
2012-08-15 08:21:00 +08:00
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
|
2011-07-04 15:41:53 +08:00
|
|
|
|
2011-07-04 11:40:26 +08:00
|
|
|
# Configure files
|
2012-08-15 05:09:01 +08:00
|
|
|
add_definitions("-DHAVE_CONFIG_H")
|
2013-08-12 18:53:04 +08:00
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
2011-07-04 11:40:26 +08:00
|
|
|
|
2012-10-15 00:58:09 +08:00
|
|
|
# RPATH configuration
|
2012-10-16 05:13:54 +08: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 08:55:15 +08:00
|
|
|
set(CMAKE_INSTALL_RPATH "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:\$ORIGIN/..")
|
2012-10-15 00:58:09 +08:00
|
|
|
|
2013-09-18 18:50:10 +08:00
|
|
|
# Android profiling
|
|
|
|
if(ANDROID)
|
2013-09-18 19:12:52 +08:00
|
|
|
if(WITH_GPROF)
|
2013-09-18 18:50:10 +08:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pg")
|
|
|
|
set(PROFILER_LIBRARIES
|
|
|
|
"${FREERDP_ANDROID_EXTERNAL_PROFILER_PATH}/obj/local/${ANDROID_ABI}/libandroid-ndk-profiler.a")
|
|
|
|
include_directories("${FREERDP_ANDROID_EXTERNAL_PROFILER_PATH}")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2012-10-01 08:15:42 +08:00
|
|
|
# Unit Tests
|
|
|
|
|
2012-10-30 03:02:35 +08:00
|
|
|
include(CTest)
|
2012-10-01 08:15:42 +08:00
|
|
|
|
2013-03-01 03:54:08 +08:00
|
|
|
if(BUILD_TESTING)
|
2012-10-30 03:02:35 +08:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DFREERDP_TEST_EXPORTS")
|
|
|
|
|
2012-10-01 08:15:42 +08:00
|
|
|
enable_testing()
|
2012-10-30 03:02:35 +08:00
|
|
|
|
2012-10-19 09:11:12 +08:00
|
|
|
if(MSVC)
|
|
|
|
set(TESTING_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
|
|
|
|
else()
|
|
|
|
set(TESTING_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Testing")
|
|
|
|
endif()
|
2012-10-01 08:15:42 +08:00
|
|
|
endif()
|
|
|
|
|
2012-09-21 08:45:56 +08:00
|
|
|
# WinPR
|
2013-08-12 19:51:18 +08:00
|
|
|
include_directories("${CMAKE_SOURCE_DIR}/winpr/include")
|
|
|
|
include_directories("${CMAKE_BINARY_DIR}/winpr/include")
|
2012-09-21 08:45:56 +08:00
|
|
|
|
|
|
|
add_subdirectory(winpr)
|
|
|
|
|
2012-01-23 21:19:40 +08:00
|
|
|
if(WITH_CUNIT)
|
2012-10-25 19:41:28 +08:00
|
|
|
message(FATAL_ERROR "cunit (WITH_CUNIT) is deprecated please use BUILD_TESTING to build ctest tests.
|
|
|
|
The cunit directory contains the old tests and is kept until all tests are converted.")
|
2011-07-03 02:23:59 +08:00
|
|
|
endif()
|
|
|
|
|
2011-07-04 11:40:26 +08:00
|
|
|
# Sub-directories
|
2012-08-14 11:19:51 +08:00
|
|
|
|
2013-04-04 18:28:52 +08: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 08:37:04 +08:00
|
|
|
add_subdirectory(include)
|
2012-05-22 04:01:24 +08:00
|
|
|
|
2012-08-14 11:19:51 +08:00
|
|
|
add_subdirectory(libfreerdp)
|
2011-08-17 11:54:42 +08:00
|
|
|
|
2012-08-13 06:05:25 +08:00
|
|
|
if(WITH_CHANNELS)
|
|
|
|
add_subdirectory(channels)
|
|
|
|
endif()
|
2011-07-18 11:16:31 +08:00
|
|
|
|
2013-03-29 21:28:27 +08:00
|
|
|
if (IOS)
|
2013-04-30 07:53:56 +08:00
|
|
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "")
|
2013-10-06 03:47:03 +08:00
|
|
|
if (IOS_PLATFORM MATCHES "SIMULATOR")
|
|
|
|
set(CMAKE_OSX_SYSROOT "iphonesimulator")
|
|
|
|
else()
|
|
|
|
set(CMAKE_OSX_SYSROOT "iphoneos")
|
|
|
|
endif()
|
2013-03-29 21:28:27 +08:00
|
|
|
endif()
|
2013-04-30 07:53:56 +08:00
|
|
|
|
2012-01-23 01:26:30 +08:00
|
|
|
if(WITH_CLIENT)
|
2012-01-23 01:14:06 +08:00
|
|
|
add_subdirectory(client)
|
|
|
|
endif()
|
|
|
|
|
2012-01-23 01:26:30 +08:00
|
|
|
if(WITH_SERVER)
|
2012-01-23 01:14:06 +08:00
|
|
|
add_subdirectory(server)
|
|
|
|
endif()
|
|
|
|
|
2013-10-29 10:09:31 +08:00
|
|
|
# Exporting
|
|
|
|
|
2013-10-30 02:47:40 +08:00
|
|
|
if(${CMAKE_VERSION} VERSION_GREATER "2.8.10")
|
2013-10-29 10:09:31 +08:00
|
|
|
|
2013-10-30 02:47:40 +08:00
|
|
|
export(PACKAGE freerdp)
|
2013-10-29 10:09:31 +08:00
|
|
|
|
2013-10-30 03:16:44 +08:00
|
|
|
set(FREERDP_CMAKE_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/FreeRDP")
|
2013-10-29 10:09:31 +08:00
|
|
|
|
2013-10-30 02:47:40 +08:00
|
|
|
set(FREERDP_INCLUDE_DIR "include")
|
2013-10-30 03:16:44 +08:00
|
|
|
set(FREERDP_MONOLITHIC_BUILD ${MONOLITHIC_BUILD})
|
2013-10-29 10:09:31 +08:00
|
|
|
|
2013-10-30 02:47:40 +08:00
|
|
|
configure_package_config_file(FreeRDPConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FreeRDPConfig.cmake
|
|
|
|
INSTALL_DESTINATION ${FREERDP_CMAKE_INSTALL_DIR}
|
2013-10-30 03:16:44 +08:00
|
|
|
PATH_VARS FREERDP_INCLUDE_DIR FREERDP_MONOLITHIC_BUILD)
|
2013-10-29 10:09:31 +08:00
|
|
|
|
2013-10-30 02:47:40 +08:00
|
|
|
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/FreeRDPConfigVersion.cmake
|
|
|
|
VERSION ${FREERDP_VERSION} COMPATIBILITY SameMajorVersion)
|
|
|
|
|
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FreeRDPConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FreeRDPConfigVersion.cmake
|
|
|
|
DESTINATION ${FREERDP_CMAKE_INSTALL_DIR})
|
|
|
|
|
|
|
|
install(EXPORT FreeRDPTargets DESTINATION ${FREERDP_CMAKE_INSTALL_DIR})
|
|
|
|
|
|
|
|
endif()
|
2013-10-29 10:09:31 +08:00
|
|
|
|
2012-10-17 09:57:43 +08:00
|
|
|
# Packaging
|
|
|
|
|
2013-09-10 10:25:47 +08:00
|
|
|
set(CMAKE_CPACK_INCLUDE_FILE "CMakeCPack.cmake")
|
2013-01-31 07:54:08 +08:00
|
|
|
|
2013-09-10 10:25:47 +08:00
|
|
|
if(NOT (VENDOR MATCHES "FreeRDP"))
|
|
|
|
if(DEFINED CLIENT_VENDOR_PATH)
|
2013-09-11 02:46:48 +08:00
|
|
|
if(EXISTS "${CMAKE_SOURCE_DIR}/${CLIENT_VENDOR_PATH}/CMakeCPack.cmake")
|
2013-09-10 10:25:47 +08:00
|
|
|
set(CMAKE_CPACK_INCLUDE_FILE "${CLIENT_VENDOR_PATH}/CMakeCPack.cmake")
|
2013-09-04 08:37:04 +08:00
|
|
|
endif()
|
2012-11-13 02:17:44 +08:00
|
|
|
endif()
|
2013-01-29 19:59:58 +08:00
|
|
|
endif()
|
|
|
|
|
2013-09-11 02:46:48 +08:00
|
|
|
#message("VENDOR: ${VENDOR} CLIENT_VENDOR_PATH: ${CLIENT_VENDOR_PATH} CMAKE_CPACK_INCLUDE_FILE: ${CMAKE_CPACK_INCLUDE_FILE}")
|
|
|
|
|
2013-09-10 10:25:47 +08:00
|
|
|
include(${CMAKE_CPACK_INCLUDE_FILE})
|