~ubuntu-branches/ubuntu/trusty/compiz/trusty

2890.4.4 by Thomas Voß
Switched to Google test.
1
#
2
# Main CMakeLists.txt for compiz
3
#
2092 by Dennis Kasprzyk
Initial version of CMake build system.
4
project (compiz)
5
2276 by Dennis Kasprzyk
New generalized build system.
6
set (CMAKE_MODULE_PATH_ORIG ${CMAKE_MODULE_PATH})
2609.1.67 by Sam Spilsbury
Added a simple CMake buildsystem extensions system
7
set (COMPIZ_CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
8
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${COMPIZ_CMAKE_MODULE_PATH})
2890.4.4 by Thomas Voß
Switched to Google test.
9
3248.53.1 by Sam Spilsbury
Added suppressions for python and glib so that their leaks don't show up
10
include (CTest)
11
3248.56.429 by Sam Spilsbury
Set the memcheck options too
12
set (MEMORYCHECK_COMMAND_OPTIONS --trace-children=yes)
3248.53.1 by Sam Spilsbury
Added suppressions for python and glib so that their leaks don't show up
13
set (MEMORYCHECK_SUPPRESSIONS_FILE ${CMAKE_SOURCE_DIR}/tests/experimental-memcheck/compiz.supp CACHE FILEPATH "" FORCE)
3248.4.1 by smspillaz
Include Dart in CMakeLists and set MEMCHECK_COMMAND so that we can run the tests
14
15
include (Dart)
16
2890.4.4 by Thomas Voß
Switched to Google test.
17
# Common compiz CMake macros & functions.
2276 by Dennis Kasprzyk
New generalized build system.
18
include (CompizCommon)
2890.4.4 by Thomas Voß
Switched to Google test.
19
# Packaging-specific CMake macros & functions.
2609.1.67 by Sam Spilsbury
Added a simple CMake buildsystem extensions system
20
include (CompizPackage)
3248.28.62 by Sam Spilsbury
Added wrappers around recompilation code to ensure it only gets
21
22
# GSettings schema recompilation
23
include (CompizGSettings)
24
3248.176.9 by Automatic PS uploader
Import upstream version 0.9.9~daily13.02.26
25
# Google Test and Xorg-GTest
26
include (XorgGTest)
27
2092 by Dennis Kasprzyk
Initial version of CMake build system.
28
include (cmake/base.cmake)
2890.4.4 by Thomas Voß
Switched to Google test.
29
# Check if specific function is present in library.
2092 by Dennis Kasprzyk
Initial version of CMake build system.
30
include (CheckFunctionExists)
2890.4.4 by Thomas Voß
Switched to Google test.
31
32
enable_testing()
33
34
# Import macro for doing coverage reporting
35
include(EnableCoverageReport)
36
37
#####################################################################
38
# Enable code coverage calculation with gcov/gcovr/lcov
39
# Usage:
40
#  * Switch build type to coverage (use ccmake or cmake-gui)
41
#  * Invoke make, make test, make coverage
42
#  * Find html report in subdir coveragereport
43
#  * Find xml report feasible for jenkins in coverage.xml
44
#####################################################################
45
IF(CMAKE_BUILD_TYPE MATCHES [cC][oO][vV][eE][rR][aA][gG][eE])
46
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftest-coverage -fprofile-arcs" )
47
  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftest-coverage -fprofile-arcs" )
48
  SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -ftest-coverage -fprofile-arcs" )
49
  SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -ftest-coverage -fprofile-arcs" )
50
ENDIF(CMAKE_BUILD_TYPE MATCHES [cC][oO][vV][eE][rR][aA][gG][eE])
51
52
#set (CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;MinSizeRe" CACHE INTERNAL "" FORCE)
53
#if (NOT CMAKE_BUILD_TYPE)
54
#    set (CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type (Debug/Release/RelWithDebInfo/MinSizeRe)" FORCE)
55
#endif (NOT CMAKE_BUILD_TYPE)
2092 by Dennis Kasprzyk
Initial version of CMake build system.
56
2755.4.4 by Sam Spilsbury
Add a proper set of a release targets in the CMake buildsystem for all compiz
57
file (READ ${CMAKE_SOURCE_DIR}/VERSION COMPIZ_RELEASE_VERSION LIMIT 12 OFFSET 0)
58
string (STRIP ${COMPIZ_RELEASE_VERSION} COMPIZ_RELEASE_VERSION)
59
60
set (VERSION ${COMPIZ_RELEASE_VERSION})
2092 by Dennis Kasprzyk
Initial version of CMake build system.
61
2733.1.7 by Sam Spilsbury
Bump decoration API
62
set (DECOR_INTERFACE_VERSION 20110504)
2092 by Dennis Kasprzyk
Initial version of CMake build system.
63
2569 by Sam Spilsbury
Add COMPIZ_ENABLE_PACKAGING option so that distros with default settings for prefix, etc don't override
64
if (COMPIZ_PACKAGING_ENABLED)
65
    set (prefix ${CMAKE_INSTALL_PREFIX}                   CACHE PATH "prefix")
66
    set (exec_prefix ${CMAKE_INSTALL_PREFIX}/bin          CACHE PATH "bindir")
67
    set (libdir ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}  CACHE PATH "libdir")
68
    set (includedir ${CMAKE_INSTALL_PREFIX}/include       CACHE PATH "includedir")
69
    set (datadir ${CMAKE_INSTALL_PREFIX}/share            CACHE PATH "datadir")
70
else (COMPIZ_PACKAGING_ENABLED)
71
    set (prefix ${CMAKE_INSTALL_PREFIX}                 )
72
    set (exec_prefix ${CMAKE_INSTALL_PREFIX}/bin        )
73
    set (libdir ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
74
    set (includedir ${CMAKE_INSTALL_PREFIX}/include     )
75
    set (datadir ${CMAKE_INSTALL_PREFIX}/share          )
76
endif (COMPIZ_PACKAGING_ENABLED)
2092 by Dennis Kasprzyk
Initial version of CMake build system.
77
78
set (compiz_plugindir ${libdir}/compiz)
2695 by Sam Spilsbury
Fix the loading and installation of images - core images should
79
set (compiz_sharedir ${datadir}/compiz/)
2092 by Dennis Kasprzyk
Initial version of CMake build system.
80
set (compiz_metadatadir ${datadir}/compiz)
2276 by Dennis Kasprzyk
New generalized build system.
81
set (COMPIZ_I18N_DIR ${CMAKE_SOURCE_DIR}/po)
2092 by Dennis Kasprzyk
Initial version of CMake build system.
82
3248.175.1 by Automatic PS uploader
Import upstream version 0.9.9~daily12.12.05
83
# Force re-generation of uninstall script
84
compiz_set (_compiz_uninstall_rule_created FALSE)
85
3248.28.62 by Sam Spilsbury
Added wrappers around recompilation code to ensure it only gets
86
# Don't allow subdirectories to add schema recompile rule
87
set_property (GLOBAL
3248.132.1 by Sam Spilsbury
Regenerate the local settings recompilation rule when cmake is re-run
88
	      PROPERTY GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE
89
	      TRUE)
90
set_property (GLOBAL
3248.28.62 by Sam Spilsbury
Added wrappers around recompilation code to ensure it only gets
91
	      PROPERTY COMPIZ_INHIBIT_ADD_INSTALL_RECOMPILE_RULE
92
	      TRUE)
93
2890.4.4 by Thomas Voß
Switched to Google test.
94
# Translation
2092 by Dennis Kasprzyk
Initial version of CMake build system.
95
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
set (GETTEXT_PACKAGE compiz)
97
98
set (COMPIZ_REQUIRES
2494 by Sam Spilsbury
Link required libraries explicitly.
99
    x11
100
    xext
2109 by Dennis Kasprzyk
Link compiz against xdamage and xcomposite to prevent segmentation faults on shutdown.
101
    xdamage
102
    xcomposite
2092 by Dennis Kasprzyk
Initial version of CMake build system.
103
    x11-xcb
104
    xrandr
105
    xinerama
3248.176.21 by Ubuntu daily release
Import upstream version 0.9.10+13.10.20130822
106
    xi
2092 by Dennis Kasprzyk
Initial version of CMake build system.
107
    ice
108
    sm
109
    libxml-2.0
110
    libxslt
2610 by Jason Smith
First pass at glib loop, invariably breaking things
111
    glib-2.0
112
    gio-2.0
2665.2.1 by Sam Spilsbury
Port C based glib to C++ glibmm
113
    glibmm-2.4
2162 by Dennis Kasprzyk
Fixed pkg-config check.
114
    "libstartup-notification-1.0 >= 0.7"
2092 by Dennis Kasprzyk
Initial version of CMake build system.
115
)
116
117
set (DECORATION_REQUIRES xrender)
118
2276 by Dennis Kasprzyk
New generalized build system.
119
compiz_pkg_check_modules (COMPIZ REQUIRED ${COMPIZ_REQUIRES})
120
compiz_pkg_check_modules (LIBDECORATION REQUIRED ${DECORATION_REQUIRES})
121
122
include (CompizDefaults)
2092 by Dennis Kasprzyk
Initial version of CMake build system.
123
2099 by Dennis Kasprzyk
Added CMake package generation and fixed compiling
124
set (_compiz_package_string "Compiz ${VERSION}")
2978.1.5 by smspillaz
Fix typo
125
set (_compiz_package "Compiz")
2092 by Dennis Kasprzyk
Initial version of CMake build system.
126
2276 by Dennis Kasprzyk
New generalized build system.
127
compiz_configure_file (${compiz_SOURCE_DIR}/config.h.core.in ${compiz_BINARY_DIR}/generated/config.h)
2092 by Dennis Kasprzyk
Initial version of CMake build system.
128
2294 by Dennis Kasprzyk
Avoid unneeded recompilation after cmake execution.
129
compiz_configure_file (
2096 by Dennis Kasprzyk
Generate compiz.pc
130
    ${CMAKE_SOURCE_DIR}/compiz.pc.in
131
    ${CMAKE_BINARY_DIR}/compiz.pc
132
    COMPIZ_REQUIRES
133
    COMPIZ_CFLAGS
134
)
135
2276 by Dennis Kasprzyk
New generalized build system.
136
install (
137
    FILES ${CMAKE_BINARY_DIR}/compiz.pc
3217.2.1 by smspillaz
Remove COMPIZ_DESTDIR
138
    DESTINATION ${libdir}/pkgconfig
2276 by Dennis Kasprzyk
New generalized build system.
139
)
140
3248.176.10 by Automatic PS uploader
Import upstream version 0.9.9~daily13.02.28
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)
156
3248.19.1 by smspillaz
Fix COMPIZ_BUILD_TESTING being set to OFF
157
if (COMPIZ_BUILD_TESTING)
158
3248.176.21 by Ubuntu daily release
Import upstream version 0.9.10+13.10.20130822
159
    include (GoogleTest)
3248.176.9 by Automatic PS uploader
Import upstream version 0.9.9~daily13.02.26
160
161
    if (GOOGLE_TEST_AND_MOCK_FOUND)
162
163
	if (BUILD_XORG_GTEST)
164
165
	    find_package (XorgGTest)
166
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)
169
170
	    if (XORG_GTEST_FOUND)
171
172
		build_xorg_gtest_locally (${CMAKE_BINARY_DIR}/__xorg_gtest)
173
174
	    else (XORG_GTEST_FOUND)
175
176
		set (BUILD_XORG_GTEST FALSE)
177
178
	    endif (XORG_GTEST_FOUND)
179
180
	endif (BUILD_XORG_GTEST)
181
182
    else (GOOGLE_TEST_AND_MOCK_FOUND)
183
3248.19.1 by smspillaz
Fix COMPIZ_BUILD_TESTING being set to OFF
184
	set (COMPIZ_BUILD_TESTING OFF CACHE BOOL "" FORCE)
3248.176.9 by Automatic PS uploader
Import upstream version 0.9.9~daily13.02.26
185
	set (BUILD_XORG_GTEST OFF CACHE BOOL "" FORCE)
186
187
    endif (GOOGLE_TEST_AND_MOCK_FOUND)
188
189
else (COMPIZ_BUILD_TESTING)
190
191
    set (BUILD_XORG_GTEST OFF CACHE BOOL "" FORCE)
3248.19.1 by smspillaz
Fix COMPIZ_BUILD_TESTING being set to OFF
192
193
endif (COMPIZ_BUILD_TESTING)
2890.5.2 by Sam Spilsbury
Style fixes, use google-mock
194
2890.4.4 by Thomas Voß
Switched to Google test.
195
# Add the rest of compiz
2276 by Dennis Kasprzyk
New generalized build system.
196
add_subdirectory (cmake)
2092 by Dennis Kasprzyk
Initial version of CMake build system.
197
add_subdirectory (include)
198
add_subdirectory (images)
199
add_subdirectory (libdecoration)
200
add_subdirectory (gtk)
201
add_subdirectory (kde)
202
add_subdirectory (po)
203
add_subdirectory (metadata)
2285 by Dennis Kasprzyk
Use bcop in core.
204
add_subdirectory (src)
3203.2.1 by smspillaz
Enable libcompizconfig for building. Move ccp to plugins/
205
add_subdirectory (compizconfig)
2276 by Dennis Kasprzyk
New generalized build system.
206
add_subdirectory (xslt)
2092 by Dennis Kasprzyk
Initial version of CMake build system.
207
add_subdirectory (plugins)
2919.2.1 by Robert Ancell
Added Xig Testing infrastructure to compiz
208
add_subdirectory (tests)
2092 by Dennis Kasprzyk
Initial version of CMake build system.
209
3248.176.11 by Automatic PS uploader
Import upstream version 0.9.9~daily13.03.01
210
# Leave last - the cmake_install.cmake script is guaranteed
3248.28.62 by Sam Spilsbury
Added wrappers around recompilation code to ensure it only gets
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)
214
# in CMake
3248.28.66 by Sam Spilsbury
Added postinst
215
add_subdirectory (postinst)
3248.28.62 by Sam Spilsbury
Added wrappers around recompilation code to ensure it only gets
216
2543 by Sam Spilsbury
Added compiz_ensure_linkage function and dropped some more rpath stuff
217
compiz_ensure_linkage ()
2276 by Dennis Kasprzyk
New generalized build system.
218
compiz_package_generation ("Compiz")
219
compiz_add_uninstall ()
2534 by Sam Spilsbury
Add compiz_add_git_dist macro to CompizCommon
220
compiz_add_git_dist ()
2755.4.2 by Sam Spilsbury
Added a distcheck target
221
compiz_add_distcheck ()
2755.4.4 by Sam Spilsbury
Add a proper set of a release targets in the CMake buildsystem for all compiz
222
compiz_add_release ()
223
compiz_add_release_signoff ()
2276 by Dennis Kasprzyk
New generalized build system.
224
3248.37.1 by Sam Spilsbury
Generate the CTestFile.cmake using cmake itself (LP: #1024214)
225
if (COMPIZ_BUILD_TESTING)
226
    compiz_generate_testfile_target ()
227
endif (COMPIZ_BUILD_TESTING)
228
2095 by Dennis Kasprzyk
Provide summary configure output and create compiz-common.h
229
_print_configure_results ()
230
2276 by Dennis Kasprzyk
New generalized build system.
231
_check_compiz_cmake_macro (${CMAKE_MODULE_PATH_ORIG})
232
2890.4.4 by Thomas Voß
Switched to Google test.
233
# Enable coverage reporting for compiz
3248.46.1 by Sam Spilsbury
Mark coverage reports correctly
234
compiz_generate_coverage_report()
2890.4.4 by Thomas Voß
Switched to Google test.
235
2095 by Dennis Kasprzyk
Provide summary configure output and create compiz-common.h
236