Blame view

CMakeLists.txt 7.28 KB
ae1fa16f   Thomas Voß   Switched to Googl...
1
2
3
#
# Main CMakeLists.txt for compiz
#
5e20ac58   Eleni Maria Stea   CMake couldn't fi...
4
project (compiz C CXX)
e26ab8c8   Dennis Kasprzyk   Initial version o...
5

c68df3f3   Dennis Kasprzyk   New generalized b...
6
set (CMAKE_MODULE_PATH_ORIG ${CMAKE_MODULE_PATH})
322ea64a   Sam Spilsbury   Added a simple CM...
7
8
set (COMPIZ_CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${COMPIZ_CMAKE_MODULE_PATH})
ae1fa16f   Thomas Voß   Switched to Googl...
9

a8d88e24   Sam Spilsbury   Added suppression...
10
include (CTest)
059f712c   Stephen M. Webb   Ubuntu: made pack...
11
include (GNUInstallDirs)
a8d88e24   Sam Spilsbury   Added suppression...
12

34b22e33   Sam Spilsbury   Set the memcheck ...
13
set (MEMORYCHECK_COMMAND_OPTIONS --trace-children=yes)
a8d88e24   Sam Spilsbury   Added suppression...
14
set (MEMORYCHECK_SUPPRESSIONS_FILE ${CMAKE_SOURCE_DIR}/tests/experimental-memcheck/compiz.supp CACHE FILEPATH "" FORCE)
a832a43a   smspillaz   Include Dart in C...
15
16
17

include (Dart)

ae1fa16f   Thomas Voß   Switched to Googl...
18
# Common compiz CMake macros & functions.
c68df3f3   Dennis Kasprzyk   New generalized b...
19
include (CompizCommon)
ae1fa16f   Thomas Voß   Switched to Googl...
20
# Packaging-specific CMake macros & functions.
322ea64a   Sam Spilsbury   Added a simple CM...
21
include (CompizPackage)
fdfdaa9d   Sam Spilsbury   Added wrappers ar...
22
23
24
25

# GSettings schema recompilation
include (CompizGSettings)

cc3c62ad   Sam Spilsbury   Clean up the Find...
26
# Google Test and Xorg-GTest
cc3c62ad   Sam Spilsbury   Clean up the Find...
27
28
include (XorgGTest)

e26ab8c8   Dennis Kasprzyk   Initial version o...
29
include (cmake/base.cmake)
ae1fa16f   Thomas Voß   Switched to Googl...
30
# Check if specific function is present in library.
e26ab8c8   Dennis Kasprzyk   Initial version o...
31
include (CheckFunctionExists)
c68df3f3   Dennis Kasprzyk   New generalized b...
32

ae1fa16f   Thomas Voß   Switched to Googl...
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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)
e26ab8c8   Dennis Kasprzyk   Initial version o...
57

4786662e   Sam Spilsbury   Add a proper set ...
58
59
60
61
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})
e26ab8c8   Dennis Kasprzyk   Initial version o...
62

b12108a7   Sam Spilsbury   Bump decoration API
63
set (DECOR_INTERFACE_VERSION 20110504)
e26ab8c8   Dennis Kasprzyk   Initial version o...
64

046fe9e4   Sam Spilsbury   Add COMPIZ_ENABLE...
65
66
67
if (COMPIZ_PACKAGING_ENABLED)
    set (prefix ${CMAKE_INSTALL_PREFIX}                   CACHE PATH "prefix")
    set (exec_prefix ${CMAKE_INSTALL_PREFIX}/bin          CACHE PATH "bindir")
059f712c   Stephen M. Webb   Ubuntu: made pack...
68
69
70
    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")
046fe9e4   Sam Spilsbury   Add COMPIZ_ENABLE...
71
72
73
else (COMPIZ_PACKAGING_ENABLED)
    set (prefix ${CMAKE_INSTALL_PREFIX}                 )
    set (exec_prefix ${CMAKE_INSTALL_PREFIX}/bin        )
059f712c   Stephen M. Webb   Ubuntu: made pack...
74
75
76
    set (libdir ${CMAKE_INSTALL_FULL_LIBDIR}            )
    set (includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR}    )
    set (datadir ${CMAKE_INSTALL_FULL_DATAROOTDIR}      )
046fe9e4   Sam Spilsbury   Add COMPIZ_ENABLE...
77
endif (COMPIZ_PACKAGING_ENABLED)
e26ab8c8   Dennis Kasprzyk   Initial version o...
78
79

set (compiz_plugindir ${libdir}/compiz)
5ad9b1d8   Sam Spilsbury   Fix the loading a...
80
set (compiz_sharedir ${datadir}/compiz/)
e26ab8c8   Dennis Kasprzyk   Initial version o...
81
set (compiz_metadatadir ${datadir}/compiz)
c68df3f3   Dennis Kasprzyk   New generalized b...
82
set (COMPIZ_I18N_DIR ${CMAKE_SOURCE_DIR}/po)
e26ab8c8   Dennis Kasprzyk   Initial version o...
83

6aa7bc9c   Sam Spilsbury   Clean up the CMak...
84
85
86
# Force re-generation of uninstall script
compiz_set (_compiz_uninstall_rule_created FALSE)

fdfdaa9d   Sam Spilsbury   Added wrappers ar...
87
88
# Don't allow subdirectories to add schema recompile rule
set_property (GLOBAL
ab312065   Sam Spilsbury   Regenerate the lo...
89
90
91
	      PROPERTY GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE
	      TRUE)
set_property (GLOBAL
fdfdaa9d   Sam Spilsbury   Added wrappers ar...
92
93
94
	      PROPERTY COMPIZ_INHIBIT_ADD_INSTALL_RECOMPILE_RULE
	      TRUE)

ae1fa16f   Thomas Voß   Switched to Googl...
95
# Translation
e26ab8c8   Dennis Kasprzyk   Initial version o...
96
97
98
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)

e26ab8c8   Dennis Kasprzyk   Initial version o...
99
set (COMPIZ_REQUIRES
fdde2dfb   Sam Spilsbury   Link required lib...
100
101
    x11
    xext
767138dd   Dennis Kasprzyk   Link compiz again...
102
103
    xdamage
    xcomposite
5e204f5f   Marco Trevisan (Treviño)   Screen: use XCurs...
104
    xcursor
e26ab8c8   Dennis Kasprzyk   Initial version o...
105
106
107
    x11-xcb
    xrandr
    xinerama
1632d999   Hu Kang stevenhooke11@gmail.com   startup notificat...
108
    xi
e26ab8c8   Dennis Kasprzyk   Initial version o...
109
110
111
112
    ice
    sm
    libxml-2.0
    libxslt
70fb6af5   Jason Smith   First pass at gli...
113
114
    glib-2.0
    gio-2.0
4ab1789b   Sam Spilsbury   Port C based glib...
115
    glibmm-2.4
14b94808   Dennis Kasprzyk   Fixed pkg-config ...
116
    "libstartup-notification-1.0 >= 0.7"
e26ab8c8   Dennis Kasprzyk   Initial version o...
117
118
)

08ec1064   Charles Bos   add spaces betwee...
119
set (DECORATION_REQUIRES "xrender >= 0.9.3")
e26ab8c8   Dennis Kasprzyk   Initial version o...
120

c68df3f3   Dennis Kasprzyk   New generalized b...
121
122
123
compiz_pkg_check_modules (COMPIZ REQUIRED ${COMPIZ_REQUIRES})
compiz_pkg_check_modules (LIBDECORATION REQUIRED ${DECORATION_REQUIRES})

c68df3f3   Dennis Kasprzyk   New generalized b...
124
include (CompizDefaults)
e26ab8c8   Dennis Kasprzyk   Initial version o...
125

110faef1   Dennis Kasprzyk   Added CMake packa...
126
127
set (_compiz_package_string "Compiz ${VERSION}")
set (_compiz_package "Compiz")
e26ab8c8   Dennis Kasprzyk   Initial version o...
128

c68df3f3   Dennis Kasprzyk   New generalized b...
129
compiz_configure_file (${compiz_SOURCE_DIR}/config.h.core.in ${compiz_BINARY_DIR}/generated/config.h)
e26ab8c8   Dennis Kasprzyk   Initial version o...
130

053ff854   Dennis Kasprzyk   Avoid unneeded re...
131
compiz_configure_file (
203e5de0   Dennis Kasprzyk   Generate compiz.pc
132
133
134
135
136
137
    ${CMAKE_SOURCE_DIR}/compiz.pc.in
    ${CMAKE_BINARY_DIR}/compiz.pc
    COMPIZ_REQUIRES
    COMPIZ_CFLAGS
)

c68df3f3   Dennis Kasprzyk   New generalized b...
138
139
install (
    FILES ${CMAKE_BINARY_DIR}/compiz.pc
4ef1fe39   smspillaz   Remove COMPIZ_DES...
140
    DESTINATION ${libdir}/pkgconfig
d5808de9   Dennis Kasprzyk   C++ port of scale...
141
142
)

60761c0e   Sam Spilsbury   The Find* modules...
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
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)

997e0d9f   smspillaz   Fix COMPIZ_BUILD_...
159
if (COMPIZ_BUILD_TESTING)
b39c7ee1   smspillaz   Fix LP#964248 - B...
160

9f570b1a   Sam Spilsbury   Remove duplicatio...
161
    include (GoogleTest)
cc3c62ad   Sam Spilsbury   Clean up the Find...
162
163

    if (GOOGLE_TEST_AND_MOCK_FOUND)
b39c7ee1   smspillaz   Fix LP#964248 - B...
164

cc3c62ad   Sam Spilsbury   Clean up the Find...
165
	if (BUILD_XORG_GTEST)
b39c7ee1   smspillaz   Fix LP#964248 - B...
166

cc3c62ad   Sam Spilsbury   Clean up the Find...
167
	    find_package (XorgGTest)
b39c7ee1   smspillaz   Fix LP#964248 - B...
168

04770e7c   Sam Spilsbury   Force the stdout ...
169
170
171
	    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)

cc3c62ad   Sam Spilsbury   Clean up the Find...
172
	    if (XORG_GTEST_FOUND)
b39c7ee1   smspillaz   Fix LP#964248 - B...
173

cc3c62ad   Sam Spilsbury   Clean up the Find...
174
		build_xorg_gtest_locally (${CMAKE_BINARY_DIR}/__xorg_gtest)
b39c7ee1   smspillaz   Fix LP#964248 - B...
175

cc3c62ad   Sam Spilsbury   Clean up the Find...
176
	    else (XORG_GTEST_FOUND)
ae1fa16f   Thomas Voß   Switched to Googl...
177

cc3c62ad   Sam Spilsbury   Clean up the Find...
178
		set (BUILD_XORG_GTEST FALSE)
ae1fa16f   Thomas Voß   Switched to Googl...
179

cc3c62ad   Sam Spilsbury   Clean up the Find...
180
	    endif (XORG_GTEST_FOUND)
997e0d9f   smspillaz   Fix COMPIZ_BUILD_...
181

cc3c62ad   Sam Spilsbury   Clean up the Find...
182
	endif (BUILD_XORG_GTEST)
997e0d9f   smspillaz   Fix COMPIZ_BUILD_...
183

cc3c62ad   Sam Spilsbury   Clean up the Find...
184
    else (GOOGLE_TEST_AND_MOCK_FOUND)
997e0d9f   smspillaz   Fix COMPIZ_BUILD_...
185

181fbb70   Sam Spilsbury   Add the right dep...
186
187
	set (COMPIZ_BUILD_TESTING OFF CACHE BOOL "" FORCE)
	set (BUILD_XORG_GTEST OFF CACHE BOOL "" FORCE)
997e0d9f   smspillaz   Fix COMPIZ_BUILD_...
188

cc3c62ad   Sam Spilsbury   Clean up the Find...
189
    endif (GOOGLE_TEST_AND_MOCK_FOUND)
997e0d9f   smspillaz   Fix COMPIZ_BUILD_...
190

181fbb70   Sam Spilsbury   Add the right dep...
191
192
193
194
else (COMPIZ_BUILD_TESTING)

    set (BUILD_XORG_GTEST OFF CACHE BOOL "" FORCE)

997e0d9f   smspillaz   Fix COMPIZ_BUILD_...
195
endif (COMPIZ_BUILD_TESTING)
ae1fa16f   Thomas Voß   Switched to Googl...
196

ae1fa16f   Thomas Voß   Switched to Googl...
197
# Add the rest of compiz
c68df3f3   Dennis Kasprzyk   New generalized b...
198
add_subdirectory (cmake)
e26ab8c8   Dennis Kasprzyk   Initial version o...
199
200
201
202
203
add_subdirectory (include)
add_subdirectory (images)
add_subdirectory (libdecoration)
add_subdirectory (gtk)
add_subdirectory (kde)
e26ab8c8   Dennis Kasprzyk   Initial version o...
204
205
add_subdirectory (po)
add_subdirectory (metadata)
11ae63cc   Dennis Kasprzyk   Use bcop in core.
206
add_subdirectory (src)
850bb677   smspillaz   Enable libcompizc...
207
add_subdirectory (compizconfig)
c68df3f3   Dennis Kasprzyk   New generalized b...
208
add_subdirectory (xslt)
e26ab8c8   Dennis Kasprzyk   Initial version o...
209
add_subdirectory (plugins)
77844e96   Robert Ancell   Added Xig Testing...
210
add_subdirectory (tests)
d4c06dd1   Sam Spilsbury   Split tests up in...
211

f2ab29f3   MC Return   Fixed all guarunt...
212
# Leave last - the cmake_install.cmake script is guaranteed
fdfdaa9d   Sam Spilsbury   Added wrappers ar...
213
214
215
216
# 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
53c93887   Sam Spilsbury   Added postinst
217
add_subdirectory (postinst)
fdfdaa9d   Sam Spilsbury   Added wrappers ar...
218

c5e3a9bd   Sam Spilsbury   Added compiz_ensu...
219
compiz_ensure_linkage ()
c68df3f3   Dennis Kasprzyk   New generalized b...
220
221
compiz_package_generation ("Compiz")
compiz_add_uninstall ()
43c652a6   Sam Spilsbury   Add compiz_add_gi...
222
compiz_add_git_dist ()
58cb0b7e   Sam Spilsbury   Added a distcheck...
223
compiz_add_distcheck ()
4786662e   Sam Spilsbury   Add a proper set ...
224
225
compiz_add_release ()
compiz_add_release_signoff ()
c68df3f3   Dennis Kasprzyk   New generalized b...
226

d759dc5e   Sam Spilsbury   Generate the CTes...
227
228
229
230
if (COMPIZ_BUILD_TESTING)
    compiz_generate_testfile_target ()
endif (COMPIZ_BUILD_TESTING)

2eb617d0   Dennis Kasprzyk   Provide summary c...
231
_print_configure_results ()
e26ab8c8   Dennis Kasprzyk   Initial version o...
232

c68df3f3   Dennis Kasprzyk   New generalized b...
233
234
_check_compiz_cmake_macro (${CMAKE_MODULE_PATH_ORIG})

ae1fa16f   Thomas Voß   Switched to Googl...
235
# Enable coverage reporting for compiz
4e91dde1   Sam Spilsbury   Mark coverage rep...
236
compiz_generate_coverage_report()
ae1fa16f   Thomas Voß   Switched to Googl...

2eb617d0   Dennis Kasprzyk   Provide summary c...