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)
|
|
|
|
|
2011-07-01 04:31:07 +04:00
|
|
|
project(FreeRDP C)
|
2012-10-04 17:42:23 +04:00
|
|
|
|
2011-07-01 04:31:07 +04:00
|
|
|
set(CMAKE_COLOR_MAKEFILE ON)
|
|
|
|
|
2012-11-23 18:12:52 +04: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 07:40:26 +04:00
|
|
|
# Include cmake modules
|
|
|
|
include(CheckIncludeFiles)
|
|
|
|
include(CheckLibraryExists)
|
2012-02-16 01:28:47 +04:00
|
|
|
include(CheckStructHasMember)
|
2012-10-13 00:37:45 +04:00
|
|
|
include(CMakeDetermineSystem)
|
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)
|
2011-12-06 09:02:07 +04:00
|
|
|
include(GNUInstallDirsWrapper)
|
2011-07-02 23:44:40 +04:00
|
|
|
|
2012-01-14 22:33:04 +04:00
|
|
|
# Soname versioning
|
2011-11-11 00:46:46 +04:00
|
|
|
set(FREERDP_VERSION_MAJOR "1")
|
2012-09-21 04:45:56 +04:00
|
|
|
set(FREERDP_VERSION_MINOR "1")
|
|
|
|
set(FREERDP_VERSION_REVISION "0")
|
2012-11-14 15:32:33 +04:00
|
|
|
set(FREERDP_VERSION_SUFFIX "dev")
|
2012-11-18 20:07:33 +04:00
|
|
|
set(FREERDP_API_VERSION "${FREERDP_VERSION_MAJOR}.${FREERDP_VERSION_MINOR}")
|
|
|
|
set(FREERDP_VERSION "${FREERDP_API_VERSION}.${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()
|
2012-07-27 05:08:30 +04:00
|
|
|
include(GetGitRevisionDescription)
|
|
|
|
git_describe(GIT_REVISION --match "[0-9]*" --abbrev=4 --tags --always)
|
|
|
|
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)
|
|
|
|
set(CMAKE_BUILD_TYPE "Release")
|
|
|
|
endif()
|
|
|
|
|
2012-03-21 23:46:37 +04:00
|
|
|
if(NOT DEFINED BUILD_SHARED_LIBS)
|
2012-10-23 03:01:19 +04:00
|
|
|
if(ANDROID)
|
|
|
|
set(BUILD_SHARED_LIBS OFF)
|
|
|
|
else()
|
|
|
|
set(BUILD_SHARED_LIBS ON)
|
|
|
|
endif()
|
2011-09-01 18:18:58 +04:00
|
|
|
endif()
|
|
|
|
|
2012-10-19 06:05:06 +04:00
|
|
|
if(NOT DEFINED EXPORT_ALL_SYMBOLS)
|
2012-11-18 07:03:04 +04:00
|
|
|
set(EXPORT_ALL_SYMBOLS TRUE)
|
2012-10-19 06:05:06 +04:00
|
|
|
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()
|
2012-09-23 01:10:08 +04: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 03:28:47 +04:00
|
|
|
configure_msvc_runtime()
|
|
|
|
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")
|
|
|
|
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i686")
|
|
|
|
endif()
|
2012-12-18 18:11:04 +04:00
|
|
|
endif()
|
2011-09-20 07:02:07 +04:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
|
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")
|
|
|
|
endif()
|
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()
|
2011-08-25 06:53:06 +04:00
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
2012-01-20 14:37:55 +04:00
|
|
|
set(CMAKE_C_FLAGS_RELEASE "-DNDEBUG")
|
2011-08-11 11:03:08 +04:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
|
|
|
|
endif()
|
2012-10-11 16:30:04 +04:00
|
|
|
if(${CMAKE_VERSION} VERSION_LESS 2.8.8)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
|
|
|
endif()
|
2012-10-13 01:55:12 +04:00
|
|
|
if(WITH_SSE2)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2")
|
|
|
|
endif()
|
2011-08-11 11:03:08 +04:00
|
|
|
endif()
|
|
|
|
|
2011-08-16 22:41:12 +04:00
|
|
|
if(MSVC)
|
2012-09-03 18:47:45 +04:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Gd")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MT")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /O2")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Ob2")
|
2012-10-31 01:20:21 +04:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2")
|
2012-08-08 04:48:29 +04: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()
|
2011-09-23 22:38:16 +04:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_UNICODE")
|
2012-08-31 03:57:21 +04:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_WIN32_WINNT=0x0501")
|
2011-08-17 01:40:29 +04:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWIN32_LEAN_AND_MEAN")
|
2011-09-25 11:12:29 +04:00
|
|
|
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
|
|
|
|
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
|
2011-08-16 22:41:12 +04:00
|
|
|
endif()
|
|
|
|
|
2012-10-29 23:02:35 +04:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWINPR_EXPORTS")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DFREERDP_EXPORTS")
|
|
|
|
|
2011-07-04 07:40:26 +04:00
|
|
|
# Include files
|
|
|
|
check_include_files(fcntl.h HAVE_FCNTL_H)
|
2011-07-08 12:07:25 +04:00
|
|
|
check_include_files(unistd.h HAVE_UNISTD_H)
|
2011-11-19 21:19:16 +04:00
|
|
|
check_include_files(stdint.h HAVE_STDINT_H)
|
|
|
|
check_include_files(inttypes.h HAVE_INTTYPES_H)
|
2012-08-15 01:09:01 +04:00
|
|
|
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)
|
2011-07-04 07:40:26 +04:00
|
|
|
|
2012-02-16 01:28:47 +04:00
|
|
|
check_struct_has_member("struct tm" tm_gmtoff time.h HAVE_TM_GMTOFF)
|
|
|
|
|
2011-11-16 08:21:53 +04:00
|
|
|
# Mac OS X
|
|
|
|
if(APPLE)
|
2012-08-01 00:22:10 +04:00
|
|
|
if(IS_DIRECTORY /opt/local/include)
|
|
|
|
include_directories(/opt/local/include)
|
|
|
|
link_directories(/opt/local/lib)
|
|
|
|
endif()
|
|
|
|
if(WITH_CLANG)
|
|
|
|
set(CMAKE_C_COMPILER "clang")
|
|
|
|
endif()
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.4")
|
2011-11-16 08:21:53 +04:00
|
|
|
endif()
|
|
|
|
|
2012-11-03 03:27:01 +04:00
|
|
|
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
2012-12-20 16:09:33 +04:00
|
|
|
if(NOT ANDROID)
|
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
|
|
|
|
|
|
|
if(UNIX OR CYGWIN)
|
|
|
|
set(X11_FEATURE_TYPE "RECOMMENDED")
|
|
|
|
else()
|
|
|
|
set(X11_FEATURE_TYPE "DISABLED")
|
2012-10-14 04:31:01 +04:00
|
|
|
endif()
|
|
|
|
|
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
|
|
|
|
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")
|
|
|
|
|
|
|
|
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 02:32:58 +04:00
|
|
|
set(IPP_FEATURE_TYPE "OPTIONAL")
|
|
|
|
set(IPP_FEATURE_PURPOSE "performance")
|
|
|
|
set(IPP_FEATURE_DESCRIPTION "Intel Integrated Performance Primitives library")
|
|
|
|
|
2012-11-03 03:27:01 +04:00
|
|
|
if(WIN32)
|
|
|
|
set(X11_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")
|
|
|
|
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")
|
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")
|
|
|
|
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")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(IOS)
|
|
|
|
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")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
find_feature(X11 ${X11_FEATURE_TYPE} ${X11_FEATURE_PURPOSE} ${X11_FEATURE_DESCRIPTION})
|
|
|
|
find_feature(DirectFB ${DIRECTFB_FEATURE_TYPE} ${DIRECTFB_FEATURE_PURPOSE} ${DIRECTFB_FEATURE_DESCRIPTION})
|
|
|
|
|
|
|
|
find_feature(ZLIB ${ZLIB_FEATURE_TYPE} ${ZLIB_FEATURE_PURPOSE} ${ZLIB_FEATURE_DESCRIPTION})
|
|
|
|
find_feature(OpenSSL ${OPENSSL_FEATURE_TYPE} ${OPENSSL_FEATURE_PURPOSE} ${OPENSSL_FEATURE_DESCRIPTION})
|
|
|
|
|
|
|
|
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-01-19 02:32:58 +04:00
|
|
|
# Intel Performance Primitives
|
|
|
|
find_feature(IPP ${IPP_FEATURE_TYPE} ${IPP_FEATURE_PURPOSE} ${IPP_FEATURE_DESCRIPTION})
|
|
|
|
|
2012-11-12 22:17:44 +04:00
|
|
|
# Installation Paths
|
2012-10-07 18:21:54 +04:00
|
|
|
if(WIN32)
|
2012-11-12 22:17:44 +04:00
|
|
|
set(CMAKE_INSTALL_BINDIR ".")
|
|
|
|
set(CMAKE_INSTALL_LIBDIR ".")
|
2012-10-07 18:21:54 +04:00
|
|
|
endif()
|
|
|
|
|
2012-02-19 07:04:28 +04:00
|
|
|
# Path to put FreeRDP data
|
|
|
|
set(FREERDP_DATA_PATH "${CMAKE_INSTALL_PREFIX}/share/freerdp")
|
|
|
|
set(FREERDP_KEYMAP_PATH "${FREERDP_DATA_PATH}/keymaps")
|
2011-07-01 04:31:07 +04:00
|
|
|
|
2011-07-08 10:28:52 +04:00
|
|
|
# Path to put plugins
|
2012-10-17 10:14:19 +04:00
|
|
|
|
2012-11-18 07:03:04 +04:00
|
|
|
set(FREERDP_LIBRARY_PATH "${CMAKE_INSTALL_LIBDIR}")
|
|
|
|
|
2012-11-12 22:17:44 +04:00
|
|
|
set(FREERDP_PLUGIN_PATH "${CMAKE_INSTALL_LIBDIR}/freerdp")
|
2012-11-04 07:04:04 +04:00
|
|
|
set(FREERDP_ADDIN_PATH "${FREERDP_PLUGIN_PATH}")
|
2011-07-08 10:28:52 +04:00
|
|
|
|
2012-07-03 11:51:00 +04:00
|
|
|
# Path to put extensions
|
2012-08-15 08:26:04 +04:00
|
|
|
set(FREERDP_EXTENSION_PATH "${CMAKE_INSTALL_FULL_LIBDIR}/freerdp/extensions")
|
2012-07-03 11:51:00 +04:00
|
|
|
|
2011-07-04 11:41:53 +04:00
|
|
|
# Include directories
|
2012-08-14 07:19:51 +04:00
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
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")
|
2012-08-14 23:49:39 +04:00
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
|
2011-07-04 07:40:26 +04:00
|
|
|
|
2012-10-14 20:58:09 +04:00
|
|
|
# RPATH configuration
|
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
|
|
|
|
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
|
|
|
|
2012-10-13 17:50:02 +04:00
|
|
|
if(BUILD_TESTING)
|
2012-11-03 03:27:01 +04:00
|
|
|
find_package(Cmockery)
|
2012-10-29 23:02:35 +04:00
|
|
|
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DFREERDP_TEST_EXPORTS")
|
|
|
|
|
2012-10-01 04:15:42 +04:00
|
|
|
enable_testing()
|
2012-10-29 23:02:35 +04: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
|
|
|
|
set(WINPR_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/winpr/include")
|
|
|
|
include_directories(${WINPR_INCLUDE_DIR})
|
|
|
|
|
|
|
|
add_subdirectory(winpr)
|
|
|
|
|
2011-10-16 03:25:34 +04:00
|
|
|
# Generate pkg-config
|
2012-08-01 00:14:17 +04:00
|
|
|
if(NOT MSVC)
|
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/freerdp.pc.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp.pc @ONLY)
|
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
|
|
|
endif()
|
2011-10-16 03:25:34 +04:00
|
|
|
|
2012-01-23 17:19:40 +04:00
|
|
|
if(WITH_CUNIT)
|
2012-10-25 15:41:28 +04: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-02 22:23:59 +04:00
|
|
|
endif()
|
|
|
|
|
2011-07-04 07:40:26 +04:00
|
|
|
# Sub-directories
|
2012-08-14 07:19:51 +04:00
|
|
|
|
2011-07-01 04:31:07 +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
|
|
|
|
2012-08-13 02:05:25 +04:00
|
|
|
if(WITH_CHANNELS)
|
|
|
|
add_subdirectory(channels)
|
|
|
|
endif()
|
2011-07-18 07:16:31 +04:00
|
|
|
|
2012-01-22 21:26:30 +04:00
|
|
|
if(WITH_CLIENT)
|
2012-01-22 21:14:06 +04:00
|
|
|
add_subdirectory(client)
|
|
|
|
endif()
|
|
|
|
|
2012-01-22 21:26:30 +04:00
|
|
|
if(WITH_SERVER)
|
2012-01-22 21:14:06 +04:00
|
|
|
add_subdirectory(server)
|
|
|
|
endif()
|
|
|
|
|
2012-08-12 23:41:07 +04:00
|
|
|
if(WITH_THIRD_PARTY)
|
|
|
|
add_subdirectory(third-party)
|
2012-08-11 02:05:37 +04:00
|
|
|
endif()
|
|
|
|
|
2012-08-13 02:05:25 +04:00
|
|
|
if(NOT MSVC)
|
|
|
|
add_subdirectory(keymaps)
|
|
|
|
endif()
|
|
|
|
|
2012-10-17 05:57:43 +04:00
|
|
|
# Packaging
|
|
|
|
|
2011-10-19 16:21:14 +04:00
|
|
|
set(CPACK_SOURCE_IGNORE_FILES "/\\\\.git/;/\\\\.gitignore;/CMakeCache.txt")
|
|
|
|
|
2012-11-12 22:17:44 +04:00
|
|
|
if(NOT WIN32)
|
|
|
|
set(CPACK_PACKAGE_EXECUTABLES "xfreerdp")
|
|
|
|
if(WITH_SERVER)
|
|
|
|
set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} "xfreerdp-server")
|
|
|
|
endif()
|
2012-10-17 05:57:43 +04:00
|
|
|
endif()
|
|
|
|
|
|
|
|
set(CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
|
|
|
|
set(CPACK_TOPLEVEL_TAG "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
|
|
|
|
|
2011-10-19 16:21:14 +04:00
|
|
|
string(TOLOWER ${CMAKE_PROJECT_NAME} CMAKE_PROJECT_NAME_lower)
|
2012-10-17 05:57:43 +04:00
|
|
|
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME_lower}-${FREERDP_VERSION_FULL}-${CPACK_SYSTEM_NAME}")
|
|
|
|
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME_lower}-${FREERDP_VERSION_FULL}-${CPACK_SYSTEM_NAME}")
|
|
|
|
|
|
|
|
set(CPACK_PACKAGE_NAME "FreeRDP")
|
|
|
|
set(CPACK_PACKAGE_VENDOR "FreeRDP")
|
|
|
|
set(CPACK_PACKAGE_VERSION ${FREERDP_VERSION_FULL})
|
|
|
|
set(CPACK_PACKAGE_VERSION_MAJOR ${FREERDP_VERSION_MAJOR})
|
|
|
|
set(CPACK_PACKAGE_VERSION_MINOR ${FREERDP_VERSION_MINOR})
|
|
|
|
set(CPACK_PACKAGE_VERSION_PATCH ${FREERDP_VERSION_REVISION})
|
2012-11-12 22:17:44 +04:00
|
|
|
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "FreeRDP: A Remote Desktop Protocol Implementation")
|
2012-10-18 02:14:35 +04:00
|
|
|
|
|
|
|
set(CPACK_PACKAGE_CONTACT "Marc-Andre Moreau")
|
|
|
|
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "marcandre.moreau@gmail.com")
|
|
|
|
set(CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
|
|
|
|
|
2012-10-17 18:46:40 +04:00
|
|
|
set(CPACK_PACKAGE_INSTALL_DIRECTORY "FreeRDP")
|
|
|
|
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/LICENSE")
|
|
|
|
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
|
2012-10-17 10:14:19 +04:00
|
|
|
|
2012-10-17 21:07:29 +04:00
|
|
|
set(CPACK_NSIS_MODIFY_PATH ON)
|
2012-10-17 18:46:40 +04:00
|
|
|
set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/resources\\\\FreeRDP_Install.bmp")
|
|
|
|
set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/resources\\\\FreeRDP_Icon_96px.ico")
|
|
|
|
set(CPACK_NSIS_MUI_UNICON "${CMAKE_SOURCE_DIR}/resource\\\\FreeRDP_Icon_96px.ico")
|
2012-09-21 04:45:56 +04:00
|
|
|
|
2012-10-18 02:14:35 +04:00
|
|
|
if(MSVC)
|
|
|
|
if(MSVC_RUNTIME STREQUAL "dynamic")
|
2012-11-12 22:17:44 +04:00
|
|
|
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
|
2012-10-18 02:14:35 +04:00
|
|
|
include(InstallRequiredSystemLibraries)
|
2012-11-12 22:17:44 +04:00
|
|
|
install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
|
|
|
|
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
COMPONENT libraries)
|
2012-11-17 07:54:31 +04:00
|
|
|
|
|
|
|
|
|
|
|
set(EXTRA_DATA_DIR "pre-requisites/")
|
|
|
|
file(GLOB EXTRA_FILES "${CMAKE_SOURCE_DIR}/extra/*")
|
|
|
|
install(FILES ${EXTRA_FILES}
|
|
|
|
DESTINATION ${EXTRA_DATA_DIR}
|
|
|
|
COMPONENT extra)
|
|
|
|
|
|
|
|
set(REV_DATA_DIR "REV/")
|
|
|
|
file(GLOB REV_FILES "${CMAKE_SOURCE_DIR}/REV/*")
|
|
|
|
install(FILES ${REV_FILES}
|
|
|
|
DESTINATION ${REV_DATA_DIR}
|
|
|
|
COMPONENT rev)
|
2012-10-18 02:14:35 +04:00
|
|
|
endif()
|
2012-10-17 21:07:29 +04:00
|
|
|
endif()
|
|
|
|
|
2012-11-17 07:54:31 +04:00
|
|
|
|
|
|
|
set(CPACK_COMPONENTS_ALL client server libraries headers extra rev)
|
|
|
|
|
2012-11-12 22:17:44 +04:00
|
|
|
|
|
|
|
set(CPACK_COMPONENT_CLIENT_DISPLAY_NAME "Client")
|
|
|
|
set(CPACK_COMPONENT_CLIENT_GROUP "Applications")
|
2012-10-17 21:07:29 +04:00
|
|
|
|
2012-11-12 22:17:44 +04:00
|
|
|
set(CPACK_COMPONENT_SERVER_DISPLAY_NAME "Server")
|
|
|
|
set(CPACK_COMPONENT_SERVER_GROUP "Applications")
|
2012-10-17 21:07:29 +04:00
|
|
|
|
2012-11-12 22:17:44 +04:00
|
|
|
set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries")
|
|
|
|
set(CPACK_COMPONENT_LIBRARIES_GROUP "Runtime")
|
|
|
|
|
|
|
|
set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "Headers")
|
|
|
|
set(CPACK_COMPONENT_HEADERS_GROUP "Development")
|
|
|
|
|
|
|
|
set(CPACK_COMPONENT_GROUP_RUNTIME_DESCRIPTION "Runtime")
|
|
|
|
set(CPACK_COMPONENT_GROUP_APPLICATIONS_DESCRIPTION "Applications")
|
|
|
|
set(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION "Development")
|
|
|
|
|
|
|
|
include(CPack)
|