forked from FreeRDS/FreeRDS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
137 lines (102 loc) · 4.38 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# FreeRDP X11 Server Next Generation
# xrdp-ng cmake build script
#
# Copyright 2013 Marc-Andre Moreau <[email protected]>
#
# 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.
cmake_minimum_required(VERSION 2.8)
project(FreeRDS C)
if(FREERDP_VERSION)
set(FREERDP_BUILD ON)
endif()
set(CMAKE_COLOR_MAKEFILE ON)
include(CheckIncludeFiles)
include(CheckLibraryExists)
include(CheckStructHasMember)
include(FindPkgConfig)
include(TestBigEndian)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
if(NOT FREERDP_BUILD)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/")
endif()
include(CheckCmakeCompat)
include(FindFeature)
include(AutoVersioning)
include(ConfigOptions)
include(ComplexLibrary)
include(FeatureSummary)
include(CheckCCompilerFlag)
include(GNUInstallDirsWrapper)
include(CMakePackageConfigHelpers)
set(FREERDS_VERSION_MAJOR "0")
set(FREERDS_VERSION_MINOR "1")
set(FREERDS_VERSION_REVISION "0")
set(FREERDS_VERSION "${FREERDS_VERSION_MAJOR}.${FREERDS_VERSION_MINOR}")
set(FREERDS_VERSION_FULL "${FREERDS_VERSION}.${FREERDS_VERSION_REVISION}")
get_directory_property(INCLUDE_DIRECTORIES INCLUDE_DIRECTORIES)
list(REMOVE_ITEM INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}")
set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${INCLUDE_DIRECTORIES}")
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
set(SBINDIR "${CMAKE_INSTALL_PREFIX}/sbin")
set(SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/etc")
set(DATADIR "${CMAKE_INSTALL_PREFIX}/share")
set(LOCALSTATEDIR "${CMAKE_INSTALL_PREFIX}/var")
set(FREERDS_CFG_PATH "${SYSCONFDIR}/freerds")
set(FREERDS_SBIN_PATH "${SBINDIR}")
set(FREERDS_SHARE_PATH "${DATADIR}/freerds")
set(FREERDS_VAR_PATH "${LOCALSTATEDIR}")
set(FREERDS_PID_PATH "${LOCALSTATEDIR}/run")
set(FREERDS_LOG_PATH "${LOCALSTATEDIR}/log")
set(FREERDS_LIB_PATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_package(Threads REQUIRED)
add_definitions("-DHAVE_CONFIG_H")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_INSTALL_RPATH "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:\$ORIGIN/..")
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
if(NOT DEFINED BUILD_SHARED_LIBS)
set(BUILD_SHARED_LIBS ON)
endif()
set(PIXMAN_FEATURE_TYPE "REQUIRED")
set(PIXMAN_FEATURE_PURPOSE "Pixel Manipulation")
set(PIXMAN_FEATURE_DESCRIPTION "Pixel Manipulation Library")
set(PROTOBUFC_FEATURE_TYPE "REQUIRED")
set(PROTOBUFC_FEATURE_PURPOSE "Protobuf based RPC")
set(PROTOBUFC_FEATURE_DESCRIPTION "google protocol buffers")
find_feature(Pixman ${PIXMAN_FEATURE_TYPE} ${PIXMAN_FEATURE_PURPOSE} ${PIXMAN_FEATURE_DESCRIPTION})
find_feature(ProtobufC ${PROTOBUFC_FEATURE_TYPE} ${PROTOBUFC_FEATURE_PURPOSE} ${PROTOBUFC_FEATURE_DESCRIPTION})
include_directories(${PIXMAN_INCLUDE_DIRS})
include_directories(${PROTOBUFC_INCLUDE_DIRS})
add_subdirectory(include)
add_subdirectory(freerds)
add_subdirectory(scripts)
add_subdirectory(session-manager)
if(${CMAKE_VERSION} VERSION_GREATER "2.8.10")
export(PACKAGE freerds)
set(FREERDS_CMAKE_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/FreeRDS")
set(FREERDS_INCLUDE_DIR "include")
configure_package_config_file(FreeRDSConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FreeRDSConfig.cmake
INSTALL_DESTINATION ${FREERDS_CMAKE_INSTALL_DIR}
PATH_VARS FREERDS_INCLUDE_DIR)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/FreeRDSConfigVersion.cmake
VERSION ${FREERDS_VERSION} COMPATIBILITY SameMajorVersion)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FreeRDSConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FreeRDSConfigVersion.cmake
DESTINATION ${FREERDS_CMAKE_INSTALL_DIR})
install(EXPORT FreeRDSTargets DESTINATION ${FREERDS_CMAKE_INSTALL_DIR})
endif()