7
7
set (COMPIZ_CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
8
8
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${COMPIZ_CMAKE_MODULE_PATH})
12
set (MEMORYCHECK_COMMAND_OPTIONS --trace-children=yes)
13
set (MEMORYCHECK_SUPPRESSIONS_FILE ${CMAKE_SOURCE_DIR}/tests/experimental-memcheck/compiz.supp CACHE FILEPATH "" FORCE)
17
10
# Common compiz CMake macros & functions.
18
11
include (CompizCommon)
19
12
# Packaging-specific CMake macros & functions.
20
13
include (CompizPackage)
22
# GSettings schema recompilation
23
include (CompizGSettings)
25
# Google Test and Xorg-GTest
28
14
include (cmake/base.cmake)
29
15
# Check if specific function is present in library.
30
16
include (CheckFunctionExists)
80
66
set (compiz_metadatadir ${datadir}/compiz)
81
67
set (COMPIZ_I18N_DIR ${CMAKE_SOURCE_DIR}/po)
83
# Force re-generation of uninstall script
84
compiz_set (_compiz_uninstall_rule_created FALSE)
86
# Don't allow subdirectories to add schema recompile rule
88
PROPERTY GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE
91
PROPERTY COMPIZ_INHIBIT_ADD_INSTALL_RECOMPILE_RULE
95
70
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)
96
71
set (GETTEXT_PACKAGE compiz)
73
find_package (Boost 1.34.0 REQUIRED serialization)
98
75
set (COMPIZ_REQUIRES
137
118
FILES ${CMAKE_BINARY_DIR}/compiz.pc
138
DESTINATION ${libdir}/pkgconfig
119
DESTINATION ${COMPIZ_DESTDIR}${libdir}/pkgconfig
141
set (COMPIZ_INTERNAL_INCLUDES
142
${CMAKE_CURRENT_SOURCE_DIR}/include
143
${CMAKE_CURRENT_SOURCE_DIR}/src
144
${CMAKE_CURRENT_SOURCE_DIR}/src/timer/include
145
${CMAKE_CURRENT_SOURCE_DIR}/src/string/include
146
${CMAKE_CURRENT_SOURCE_DIR}/src/pluginclasshandler/include
147
${CMAKE_CURRENT_SOURCE_DIR}/src/point/include
148
${CMAKE_CURRENT_SOURCE_DIR}/src/rect/include
149
${CMAKE_CURRENT_SOURCE_DIR}/src/servergrab/include
150
${CMAKE_CURRENT_SOURCE_DIR}/src/region/include
151
${CMAKE_CURRENT_SOURCE_DIR}/src/window/geometry/include
152
${CMAKE_CURRENT_SOURCE_DIR}/src/window/geometry-saver/include
153
${CMAKE_CURRENT_SOURCE_DIR}/src/window/extents/include
154
${CMAKE_CURRENT_SOURCE_DIR}/src/window/constrainment/include
155
${CMAKE_CURRENT_SOURCE_DIR}/src/logmessage/include)
157
if (COMPIZ_BUILD_TESTING)
161
if (GOOGLE_TEST_AND_MOCK_FOUND)
163
if (BUILD_XORG_GTEST)
165
find_package (XorgGTest)
167
set (COMPIZ_XORG_GTEST_DIR ${CMAKE_BINARY_DIR}/__xorg_gtest CACHE PATH "Path to Xorg GTest build dir" FORCE)
168
set (COMPIZ_XORG_GTEST_WRAPPER ${COMPIZ_XORG_GTEST_DIR}/xorg_gtest_wrapper CACHE PATH "Path to Xorg GTest wrapper" FORCE)
170
if (XORG_GTEST_FOUND)
172
build_xorg_gtest_locally (${CMAKE_BINARY_DIR}/__xorg_gtest)
174
else (XORG_GTEST_FOUND)
176
set (BUILD_XORG_GTEST FALSE)
178
endif (XORG_GTEST_FOUND)
180
endif (BUILD_XORG_GTEST)
182
else (GOOGLE_TEST_AND_MOCK_FOUND)
184
set (COMPIZ_BUILD_TESTING OFF CACHE BOOL "" FORCE)
185
set (BUILD_XORG_GTEST OFF CACHE BOOL "" FORCE)
187
endif (GOOGLE_TEST_AND_MOCK_FOUND)
189
else (COMPIZ_BUILD_TESTING)
191
set (BUILD_XORG_GTEST OFF CACHE BOOL "" FORCE)
193
endif (COMPIZ_BUILD_TESTING)
122
# Build Google Test and make its headers known
127
# Check for google test and build it locally
129
"/usr/src/gtest" # Default value, adjustable by user with e.g., ccmake
132
"Path to Google test srcs"
135
find_path (GTEST_INCLUDE_DIR gtest/gtest.h)
137
if (GTEST_INCLUDE_DIR)
138
#FIXME - hardcoded is bad!
139
add_subdirectory (${GTEST_ROOT_DIR}
141
endif(GTEST_INCLUDE_DIR)
143
set (GTEST_BOTH_LIBRARIES gtest gtest_main)
144
set (GTEST_FOUND TRUE)
146
endif (NOT GTEST_FOUND)
148
find_library (GMOCK_LIBRARY gmock)
149
find_library (GMOCK_MAIN_LIBRARY gmock_main)
151
if (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND)
152
message ("Google Mock and Google Test not found - cannot build tests!")
153
set (COMPIZ_BUILD_TESTING OFF)
154
endif (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND)
156
include_directories (${GTEST_INCLUDE_DIRS})
158
find_package (Threads REQUIRED)
195
160
# Add the rest of compiz
196
161
add_subdirectory (cmake)
202
167
add_subdirectory (po)
203
168
add_subdirectory (metadata)
204
169
add_subdirectory (src)
205
add_subdirectory (compizconfig)
206
170
add_subdirectory (xslt)
207
171
add_subdirectory (plugins)
208
172
add_subdirectory (tests)
210
# Leave last - the cmake_install.cmake script is guaranteed
211
# to run in a single job, and we need to force GSettings
212
# schema recompilation to happen after all other install
213
# targets (there is no way to set install target dependencies)
215
add_subdirectory (postinst)
217
174
compiz_ensure_linkage ()
218
175
compiz_package_generation ("Compiz")
219
176
compiz_add_uninstall ()
222
179
compiz_add_release ()
223
180
compiz_add_release_signoff ()
225
if (COMPIZ_BUILD_TESTING)
226
compiz_generate_testfile_target ()
227
endif (COMPIZ_BUILD_TESTING)
229
182
_print_configure_results ()
231
184
_check_compiz_cmake_macro (${CMAKE_MODULE_PATH_ORIG})
233
186
# Enable coverage reporting for compiz
234
compiz_generate_coverage_report()
187
enable_coverage_report()