-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
240 lines (183 loc) · 7.32 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
#
# Main CMakeLists.txt for compiz
#
project (compiz C CXX)
cmake_minimum_required (VERSION 2.8.12)
set (CMAKE_MODULE_PATH_ORIG ${CMAKE_MODULE_PATH})
set (COMPIZ_CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${COMPIZ_CMAKE_MODULE_PATH})
include (CTest)
include (GNUInstallDirs)
set (MEMORYCHECK_COMMAND_OPTIONS --trace-children=yes)
set (MEMORYCHECK_SUPPRESSIONS_FILE ${CMAKE_SOURCE_DIR}/tests/experimental-memcheck/compiz.supp CACHE FILEPATH "" FORCE)
include (Dart)
# Common compiz CMake macros & functions.
include (CompizCommon)
# Packaging-specific CMake macros & functions.
include (CompizPackage)
# GSettings schema recompilation
include (CompizGSettings)
# Google Test and Xorg-GTest
include (XorgGTest)
include (cmake/base.cmake)
# Check if specific function is present in library.
include (CheckFunctionExists)
enable_testing()
# Import macro for doing coverage reporting
include(EnableCoverageReport)
#####################################################################
# Enable code coverage calculation with gcov/gcovr/lcov
# Usage:
# * Switch build type to coverage (use ccmake or cmake-gui)
# * Invoke make, make test, make coverage
# * Find html report in subdir coveragereport
# * Find xml report feasible for jenkins in coverage.xml
#####################################################################
IF(CMAKE_BUILD_TYPE MATCHES [cC][oO][vV][eE][rR][aA][gG][eE])
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftest-coverage -fprofile-arcs" )
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftest-coverage -fprofile-arcs" )
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -ftest-coverage -fprofile-arcs" )
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -ftest-coverage -fprofile-arcs" )
ENDIF(CMAKE_BUILD_TYPE MATCHES [cC][oO][vV][eE][rR][aA][gG][eE])
#set (CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;MinSizeRe" CACHE INTERNAL "" FORCE)
#if (NOT CMAKE_BUILD_TYPE)
# set (CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type (Debug/Release/RelWithDebInfo/MinSizeRe)" FORCE)
#endif (NOT CMAKE_BUILD_TYPE)
file (READ ${CMAKE_SOURCE_DIR}/VERSION COMPIZ_RELEASE_VERSION LIMIT 12 OFFSET 0)
string (STRIP ${COMPIZ_RELEASE_VERSION} COMPIZ_RELEASE_VERSION)
set (VERSION ${COMPIZ_RELEASE_VERSION})
set (DECOR_INTERFACE_VERSION 20110504)
if (COMPIZ_PACKAGING_ENABLED)
set (prefix ${CMAKE_INSTALL_PREFIX} CACHE PATH "prefix")
set (exec_prefix ${CMAKE_INSTALL_PREFIX}/bin CACHE PATH "bindir")
set (libdir ${CMAKE_INSTALL_FULL_LIBDIR} CACHE PATH "libdir")
set (includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR} CACHE PATH "includedir")
set (datadir ${CMAKE_INSTALL_FULL_DATAROOTDIR} CACHE PATH "datadir")
else (COMPIZ_PACKAGING_ENABLED)
set (prefix ${CMAKE_INSTALL_PREFIX} )
set (exec_prefix ${CMAKE_INSTALL_PREFIX}/bin )
set (libdir ${CMAKE_INSTALL_FULL_LIBDIR} )
set (includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR} )
set (datadir ${CMAKE_INSTALL_FULL_DATAROOTDIR} )
endif (COMPIZ_PACKAGING_ENABLED)
set (compiz_plugindir ${libdir}/compiz)
set (compiz_sharedir ${datadir}/compiz/)
set (compiz_metadatadir ${datadir}/compiz)
set (COMPIZ_I18N_DIR ${CMAKE_SOURCE_DIR}/po)
# Force re-generation of uninstall script
compiz_set (_compiz_uninstall_rule_created FALSE)
# Don't allow subdirectories to add schema recompile rule
set_property (GLOBAL
PROPERTY GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE
TRUE)
set_property (GLOBAL
PROPERTY COMPIZ_INHIBIT_ADD_INSTALL_RECOMPILE_RULE
TRUE)
# Translation
set (ALL_LINGUAS af ar bg bn bn_IN bs ca cs cy da de el en_GB en_US es eu et fi fr gl gu he hi hr hu id it ja ka km ko lo lt mk mr nb nl or pa pl pt pt_BR ro ru sk sl sr sv ta tr uk vi xh zh_CN zh_TW zu)
set (GETTEXT_PACKAGE compiz)
set (COMPIZ_REQUIRES
x11
xext
xdamage
xcomposite
xcursor
x11-xcb
xrandr
xinerama
xi
ice
sm
libxml-2.0
libxslt
glib-2.0
gio-2.0
glibmm-2.4
"libstartup-notification-1.0 >= 0.7"
)
set (DECORATION_REQUIRES "xrender >= 0.9.3")
compiz_pkg_check_modules (COMPIZ REQUIRED ${COMPIZ_REQUIRES})
compiz_pkg_check_modules (LIBDECORATION REQUIRED ${DECORATION_REQUIRES})
include (CompizDefaults)
set (_compiz_package_string "Compiz ${VERSION}")
set (_compiz_package "Compiz")
compiz_configure_file (${compiz_SOURCE_DIR}/config.h.core.in ${compiz_BINARY_DIR}/generated/config.h)
compiz_configure_file (
${CMAKE_SOURCE_DIR}/compiz.pc.in
${CMAKE_BINARY_DIR}/compiz.pc
COMPIZ_REQUIRES
COMPIZ_CFLAGS
)
install (
FILES ${CMAKE_BINARY_DIR}/compiz.pc
DESTINATION ${libdir}/pkgconfig
)
set (COMPIZ_INTERNAL_INCLUDES
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/src/timer/include
${CMAKE_CURRENT_SOURCE_DIR}/src/string/include
${CMAKE_CURRENT_SOURCE_DIR}/src/pluginclasshandler/include
${CMAKE_CURRENT_SOURCE_DIR}/src/point/include
${CMAKE_CURRENT_SOURCE_DIR}/src/rect/include
${CMAKE_CURRENT_SOURCE_DIR}/src/servergrab/include
${CMAKE_CURRENT_SOURCE_DIR}/src/region/include
${CMAKE_CURRENT_SOURCE_DIR}/src/window/geometry/include
${CMAKE_CURRENT_SOURCE_DIR}/src/window/geometry-saver/include
${CMAKE_CURRENT_SOURCE_DIR}/src/window/extents/include
${CMAKE_CURRENT_SOURCE_DIR}/src/window/constrainment/include
${CMAKE_CURRENT_SOURCE_DIR}/src/logmessage/include)
if (COMPIZ_BUILD_TESTING)
include (GoogleTest)
if (GOOGLE_TEST_AND_MOCK_FOUND)
if (BUILD_XORG_GTEST)
find_package (XorgGTest)
set (COMPIZ_XORG_GTEST_DIR ${CMAKE_BINARY_DIR}/__xorg_gtest CACHE PATH "Path to Xorg GTest build dir" FORCE)
set (COMPIZ_XORG_GTEST_WRAPPER ${COMPIZ_XORG_GTEST_DIR}/xorg_gtest_wrapper CACHE PATH "Path to Xorg GTest wrapper" FORCE)
if (XORG_GTEST_FOUND)
build_xorg_gtest_locally (${CMAKE_BINARY_DIR}/__xorg_gtest)
else (XORG_GTEST_FOUND)
set (BUILD_XORG_GTEST FALSE)
endif (XORG_GTEST_FOUND)
endif (BUILD_XORG_GTEST)
else (GOOGLE_TEST_AND_MOCK_FOUND)
set (COMPIZ_BUILD_TESTING OFF CACHE BOOL "" FORCE)
set (BUILD_XORG_GTEST OFF CACHE BOOL "" FORCE)
endif (GOOGLE_TEST_AND_MOCK_FOUND)
else (COMPIZ_BUILD_TESTING)
set (BUILD_XORG_GTEST OFF CACHE BOOL "" FORCE)
endif (COMPIZ_BUILD_TESTING)
# Add the rest of compiz
add_subdirectory (cmake)
add_subdirectory (include)
add_subdirectory (images)
add_subdirectory (libdecoration)
add_subdirectory (gtk)
add_subdirectory (kde)
add_subdirectory (po)
add_subdirectory (metadata)
add_subdirectory (src)
add_subdirectory (compizconfig)
add_subdirectory (xslt)
add_subdirectory (plugins)
add_subdirectory (tests)
# Leave last - the cmake_install.cmake script is guaranteed
# to run in a single job, and we need to force GSettings
# schema recompilation to happen after all other install
# targets (there is no way to set install target dependencies)
# in CMake
add_subdirectory (postinst)
compiz_ensure_linkage ()
compiz_package_generation ("Compiz")
compiz_add_uninstall ()
compiz_add_git_dist ()
compiz_add_distcheck ()
compiz_add_release ()
compiz_add_release_signoff ()
if (COMPIZ_BUILD_TESTING)
compiz_generate_testfile_target ()
endif (COMPIZ_BUILD_TESTING)
_print_configure_results ()
_check_compiz_cmake_macro (${CMAKE_MODULE_PATH_ORIG})
# Enable coverage reporting for compiz
compiz_generate_coverage_report()