summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: e9ba8e11f0e0d6e9bff75aebb62b2b26094b6778 (plain)
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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
############################################################################
# 
# Copyright 2010-2012 BMW Car IT GmbH  
# Copyright (C) 2011 DENSO CORPORATION and Robert Bosch Car Multimedia Gmbh
# 
# 
# 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.6)
project (LayerManager)

#===========================================================================================================
# cmake configuration
#===========================================================================================================
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/DefaultSettings.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/CMakeVersions.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/CustomMacros.txt)
add_subdirectory(cmake/optionalFeatures)

#===========================================================================================================
build_flag (WITH_FORCE_COPY "Force Software Copy of Pixmaps (compatibility for VMs)" OFF)
#===========================================================================================================
# no dedicated actions required here

#===========================================================================================================
build_flag (WITH_DLT "Build with DLT logging support" OFF)
#===========================================================================================================
# no dedicated actions required here

#===========================================================================================================
build_flag (WITH_STATIC_LIBRARIES "Link all plugins and libraries statically" OFF)
#===========================================================================================================
# no dedicated actions required here

#===========================================================================================================
build_flag (WITH_STYLE_CHECKING "Report styleguide problems during build (requires python)" OFF)
#===========================================================================================================
if (WITH_STYLE_CHECKING)
    set(CMAKE_C_COMPILE_OBJECT "${CMAKE_C_COMPILE_OBJECT}; ${CMAKE_SOURCE_DIR}/scripts/check_all_styles.py <SOURCE>")
    set(CMAKE_CXX_COMPILE_OBJECT "${CMAKE_CXX_COMPILE_OBJECT}; ${CMAKE_SOURCE_DIR}/scripts/check_all_styles.py <SOURCE>")
endif (WITH_STYLE_CHECKING)
add_custom_target(check-style COMMAND ${CMAKE_SOURCE_DIR}/scripts/check_style.sh)

#===========================================================================================================
build_flag (WITH_DOCUMENTATION "Generate documentation during build (requires doxygen)" OFF)
#===========================================================================================================
if (WITH_DOCUMENTATION)
    add_custom_target(doc ALL
                      COMMAND ${CMAKE_SOURCE_DIR}/generate_specification.sh
                      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
else (WITH_DOCUMENTATION)
    add_custom_target(doc
                      COMMAND ${CMAKE_SOURCE_DIR}/generate_specification.sh
                      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
endif (WITH_DOCUMENTATION)

#===========================================================================================================
build_flag (WITH_CPPCHECK "Run cppcheck during build (requires cppcheck)" OFF)
# add build target 'cppcheck' to run pre-defined configuration of cppcheck
#===========================================================================================================
if (WITH_CPPCHECK)
    set(CMAKE_C_COMPILE_OBJECT "${CMAKE_C_COMPILE_OBJECT}; cppcheck <SOURCE> ${CPPCHECK_CONFIG_STRING}")
    set(CMAKE_CXX_COMPILE_OBJECT "${CMAKE_CXX_COMPILE_OBJECT}; cppcheck <SOURCE> ${CPPCHECK_CONFIG_STRING}")
endif (WITH_CPPCHECK)
add_custom_target(cppcheck COMMAND cppcheck ${CMAKE_SOURCE_DIR}/LayerManager*/ ${CPPCHECK_CONFIG})

#===========================================================================================================
build_flag (WITH_TESTS "Build unit test binaries for all enabled components" OFF)
#===========================================================================================================
if (WITH_TESTS)
    # enable ctest if building with tests, run 'make test' after build to run all tests
    # be aware that some tests require a running layermanager
    enable_testing()
    add_subdirectory_once (3rdParty/gtest)
    add_subdirectory_once (3rdParty/gmock)
endif(WITH_TESTS)

#===========================================================================================================
build_flag (WITH_EGL_EXAMPLE "Build examples for GLES/X11 based platforms" ON)
#===========================================================================================================
if (WITH_EGL_EXAMPLE)
    add_subdirectory_once (LayerManagerUtils)
    add_subdirectory_once (LayerManagerClient/ilmClient)
    add_subdirectory_once (LayerManagerClient/ilmControl)
    add_subdirectory_once (LayerManagerExamples/EGLX11ApplicationExample)
    add_subdirectory_once (LayerManagerExamples/EGLX11MockNavigation)
endif(WITH_EGL_EXAMPLE)

#===========================================================================================================
build_flag (WITH_GLX_EXAMPLE "Build examples for OpenGL/X11 based platforms" OFF)
#===========================================================================================================
if (WITH_GLX_EXAMPLE)
    add_subdirectory_once (LayerManagerUtils)
    add_subdirectory_once (LayerManagerClient/ilmClient)
    add_subdirectory_once (LayerManagerExamples/GLXApplicationExample)
endif(WITH_GLX_EXAMPLE)

#===========================================================================================================
build_flag (WITH_CLIENTEXAMPLES "Build examples for client library usage" ON)
#===========================================================================================================
if (WITH_CLIENTEXAMPLES)
    add_subdirectory_once (LayerManagerUtils)
    add_subdirectory_once (LayerManagerClient/ilmClient)
    add_subdirectory_once (LayerManagerExamples/LayerManagerClientExample)
endif(WITH_CLIENTEXAMPLES)

#===========================================================================================================
build_flag (WITH_WL_EXAMPLE "Build examples for GLES/Wayland based platforms" OFF)
#===========================================================================================================
if (WITH_WL_EXAMPLE)
    add_subdirectory_once (LayerManagerUtils)
    add_subdirectory_once (LayerManagerClient/ilmClient)
    add_subdirectory_once (LayerManagerExamples/EGLWLApplicationExample)
    add_subdirectory_once (LayerManagerExamples/EGLWLMockNavigation)
    add_subdirectory_once (LayerManagerExamples/WLChromakeyExample)
    add_subdirectory_once (LayerManagerExamples/EGLWLInputEventExample)
endif(WITH_WL_EXAMPLE)

#===========================================================================================================
build_flag (WITH_CONTROL_BIN "Build LayerManagerControl binary" ON)
#===========================================================================================================
if (WITH_CONTROL_BIN)
    add_subdirectory_once (LayerManagerUtils)
    add_subdirectory_once (LayerManagerClient/ilmClient)
    add_subdirectory_once (LayerManagerClient/ilmControl)
    add_subdirectory_once (LayerManagerControl)
endif(WITH_CONTROL_BIN)

#===========================================================================================================
build_flag (WITH_EXAMPLE_SCENE_PROVIDER "Build scene provider plugin to run example applications" OFF)
#===========================================================================================================
if (WITH_EXAMPLE_SCENE_PROVIDER)
    add_subdirectory_once (LayerManagerCommands)
    add_subdirectory_once (LayerManagerBase)
    add_subdirectory_once (LayerManagerPlugins/SceneProvider/ExampleSceneProvider)
endif(WITH_EXAMPLE_SCENE_PROVIDER)

#===========================================================================================================
build_flag (WITH_SYSTEMD_HEALTH_MONITOR "Build plugin for systemd based health monitoring" OFF)
#===========================================================================================================
if (WITH_SYSTEMD_HEALTH_MONITOR)
    add_subdirectory_once (3rdParty/systemd)
    add_subdirectory_once (LayerManagerUtils)
    add_subdirectory_once (LayerManagerBase)
    add_subdirectory_once (LayerManagerPlugins/HealthMonitor/SystemdHealthMonitor)
endif(WITH_SYSTEMD_HEALTH_MONITOR)

#===========================================================================================================
build_flag (WITH_GENERIC_COMMUNICATOR "Build Generic Communicator Plugin based on IpcModules" ON)
#===========================================================================================================
if (WITH_GENERIC_COMMUNICATOR)
    add_subdirectory_once (LayerManagerUtils)
    add_subdirectory_once (LayerManagerBase)
    add_subdirectory_once (LayerManagerPlugins/IpcModules)
    add_subdirectory_once (LayerManagerCommands)
    add_subdirectory_once (LayerManagerPlugins/Communicators/GenericCommunicator)
endif(WITH_GENERIC_COMMUNICATOR)

#===========================================================================================================
build_flag (WITH_DESKTOP "Build renderer plugin for OpenGL/X11 based platforms" OFF)
#===========================================================================================================
if (WITH_DESKTOP)
    add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLX)
    add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/GLXRenderer)
endif(WITH_DESKTOP)

#===========================================================================================================
build_flag (WITH_GLX_LIB "Build development library for OpenGL/X11 based renderers" OFF)
#===========================================================================================================
if (WITH_GLX_LIB)
    add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLX)
endif(WITH_GLX_LIB)

#===========================================================================================================
build_flag (WITH_WAYLAND_X11 "Build renderer plugin for GLES/Wayland with X11 backend" OFF)
#===========================================================================================================
if (WITH_WAYLAND_X11)
    add_subdirectory_once (LayerManagerUtils)
    add_subdirectory_once (LayerManagerBase)
    add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandX11GLESv2)
    add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
    add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandX11GLESRenderer)
endif(WITH_WAYLAND_X11)

#===========================================================================================================
build_flag (WITH_WAYLAND_X11_LIB "Build development library for GLES/Wayland X11 based renderers" OFF)
#===========================================================================================================
if (WITH_WAYLAND_X11_LIB)
    add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandX11GLESv2)
endif(WITH_WAYLAND_X11_LIB)

#===========================================================================================================
build_flag (WITH_WAYLAND_DRM "Build renderer plugin for GLES/Wayland with DRM backend" OFF)
#===========================================================================================================
if (WITH_WAYLAND_DRM)
    add_subdirectory_once (LayerManagerUtils)
    add_subdirectory_once (LayerManagerBase)
    add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandDrmGLESv2)
    add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
    add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandDrmGLESRenderer)
endif(WITH_WAYLAND_DRM)

#===========================================================================================================
build_flag (WITH_WAYLAND_DRM_LIB "Build development library for GLES/Wayland DRM based renderers" OFF)
#===========================================================================================================
if (WITH_WAYLAND_DRM_LIB)
    add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandDrmGLESv2)
endif(WITH_WAYLAND_DRM_LIB)

#===========================================================================================================
build_flag (WITH_WAYLAND_FBDEV "Build renderer plugin for GLES/Wayland with FBDEV backend" OFF)
#===========================================================================================================
if (WITH_WAYLAND_FBDEV)
    add_subdirectory_once (LayerManagerUtils)
    add_subdirectory_once (LayerManagerBase)
    add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandFbdevGLESv2)
    add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
    add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandFbdevGLESRenderer)
endif(WITH_WAYLAND_FBDEV)

#===========================================================================================================
build_flag (WITH_WAYLAND_FBDEV_LIB "Build development library for GLES/Wayland FBDEV based renderers" OFF)
#===========================================================================================================
if (WITH_WAYLAND_FBDEV_LIB)
    add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandFbdevGLESv2)
endif(WITH_WAYLAND_FBDEV_LIB)

#===========================================================================================================
build_flag (WITH_X11_GLES "Build renderer plugin for GLES/X11 based platforms" ON)
#===========================================================================================================
if (WITH_X11_GLES)
    add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLESv2)
    add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/X11GLESRenderer)
endif(WITH_X11_GLES)

#===========================================================================================================
build_flag (WITH_GLESv2_LIB "Build development library for GLES/X11 based renderers" OFF)
#===========================================================================================================
if (WITH_GLESv2_LIB)
    add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLESv2)
endif(WITH_GLESv2_LIB)

#===========================================================================================================
build_flag (WITH_TEXT_RENDERER "Build renderer plugin with pure logging (no rendering)" OFF)
#===========================================================================================================
if (WITH_TEXT_RENDERER)
    add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/TextRenderer)
endif(WITH_TEXT_RENDERER)

#===========================================================================================================
build_flag (WITH_SERVICE_BIN "Build LayerManagerService binary" ON)
#===========================================================================================================
if (WITH_SERVICE_BIN)
    add_subdirectory_once (LayerManagerUtils)
    add_subdirectory_once (LayerManagerBase)
    add_subdirectory_once (LayerManagerService)
endif (WITH_SERVICE_BIN)

#===========================================================================================================
build_flag (WITH_CLIENT_LIB "Build LayerManagement client library" ON)
#===========================================================================================================
if (WITH_CLIENT_LIB)
    add_subdirectory_once (LayerManagerUtils)
    add_subdirectory_once (LayerManagerPlugins/IpcModules)
    add_subdirectory_once (LayerManagerClient/ilmCommon)
    add_subdirectory_once (LayerManagerClient/ilmClient)
endif (WITH_CLIENT_LIB)

#===========================================================================================================
build_flag (WITH_CONTROL_LIB "Build LayerManagement control library" ON)
#===========================================================================================================
if (WITH_CONTROL_LIB)
    add_subdirectory_once (LayerManagerUtils)
    add_subdirectory_once (LayerManagerPlugins/IpcModules)
    add_subdirectory_once (LayerManagerClient/ilmCommon)
    add_subdirectory_once (LayerManagerClient/ilmControl)
endif (WITH_CONTROL_LIB)

#===========================================================================================================
build_flag (WITH_DIRECTFB "Build renderer plugin DirectFB" OFF)
#===========================================================================================================
if (WITH_DIRECTFB)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-variadic-macros -std=c++0x")
    add_subdirectory_once (LayerManagerUtils)
    add_subdirectory_once (LayerManagerBase)
    add_subdirectory_once (LayerManagerClient/ilmClient)
    add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicDFB)
    add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/DFBRenderer)
    add_subdirectory_once (LayerManagerExamples/EGLDFBApplicationExample)
endif(WITH_DIRECTFB)

#===========================================================================================================
# store used build configuration
#===========================================================================================================
add_subdirectory_once(config)