1 ############################################################################
3 # Copyright 2010-2012 BMW Car IT GmbH
4 # Copyright (C) 2011 DENSO CORPORATION and Robert Bosch Car Multimedia Gmbh
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
19 ############################################################################
21 cmake_minimum_required (VERSION 2.6)
22 project (LayerManager)
24 #===========================================================================================================
26 #===========================================================================================================
27 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")
28 include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/DefaultSettings.txt)
29 include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/CMakeVersions.txt)
30 include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/CustomMacros.txt)
31 add_subdirectory(cmake/optionalFeatures)
33 #===========================================================================================================
34 build_flag (WITH_FORCE_COPY "Force Software Copy of Pixmaps (compatibility for VMs)" OFF)
35 #===========================================================================================================
36 # no dedicated actions required here
38 #===========================================================================================================
39 build_flag (WITH_DLT "Build with DLT logging support" OFF)
40 #===========================================================================================================
41 # no dedicated actions required here
43 #===========================================================================================================
44 build_flag (WITH_STATIC_LIBRARIES "Link all plugins and libraries statically" OFF)
45 #===========================================================================================================
46 # no dedicated actions required here
48 #===========================================================================================================
49 build_flag (WITH_STYLE_CHECKING "Report styleguide problems during build (requires python)" OFF)
50 #===========================================================================================================
51 if (WITH_STYLE_CHECKING)
52 set(CMAKE_C_COMPILE_OBJECT "${CMAKE_C_COMPILE_OBJECT}; ${CMAKE_SOURCE_DIR}/scripts/check_all_styles.py <SOURCE>")
53 set(CMAKE_CXX_COMPILE_OBJECT "${CMAKE_CXX_COMPILE_OBJECT}; ${CMAKE_SOURCE_DIR}/scripts/check_all_styles.py <SOURCE>")
54 endif (WITH_STYLE_CHECKING)
55 add_custom_target(check-style COMMAND ${CMAKE_SOURCE_DIR}/scripts/check_style.sh)
57 #===========================================================================================================
58 build_flag (WITH_DOCUMENTATION "Generate documentation during build (requires doxygen)" OFF)
59 #===========================================================================================================
60 if (WITH_DOCUMENTATION)
61 add_custom_target(doc ALL
62 COMMAND ${CMAKE_SOURCE_DIR}/generate_specification.sh
63 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
64 else (WITH_DOCUMENTATION)
66 COMMAND ${CMAKE_SOURCE_DIR}/generate_specification.sh
67 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
68 endif (WITH_DOCUMENTATION)
70 #===========================================================================================================
71 build_flag (WITH_CPPCHECK "Run cppcheck during build (requires cppcheck)" OFF)
72 # add build target 'cppcheck' to run pre-defined configuration of cppcheck
73 #===========================================================================================================
75 set(CMAKE_C_COMPILE_OBJECT "${CMAKE_C_COMPILE_OBJECT}; cppcheck <SOURCE> ${CPPCHECK_CONFIG_STRING}")
76 set(CMAKE_CXX_COMPILE_OBJECT "${CMAKE_CXX_COMPILE_OBJECT}; cppcheck <SOURCE> ${CPPCHECK_CONFIG_STRING}")
78 add_custom_target(cppcheck COMMAND cppcheck ${CMAKE_SOURCE_DIR}/LayerManager*/ ${CPPCHECK_CONFIG})
80 #===========================================================================================================
81 build_flag (WITH_TESTS "Build unit test binaries for all enabled components" OFF)
82 #===========================================================================================================
84 # enable ctest if building with tests, run 'make test' after build to run all tests
85 # be aware that some tests require a running layermanager
87 add_subdirectory_once (3rdParty/gtest)
88 add_subdirectory_once (3rdParty/gmock)
91 #===========================================================================================================
92 build_flag (WITH_EGL_EXAMPLE "Build examples for GLES/X11 based platforms" ON)
93 #===========================================================================================================
95 add_subdirectory_once (LayerManagerUtils)
96 add_subdirectory_once (LayerManagerClient/ilmClient)
97 add_subdirectory_once (LayerManagerClient/ilmControl)
98 add_subdirectory_once (LayerManagerExamples/EGLX11ApplicationExample)
99 add_subdirectory_once (LayerManagerExamples/EGLX11MockNavigation)
100 endif(WITH_EGL_EXAMPLE)
102 #===========================================================================================================
103 build_flag (WITH_GLX_EXAMPLE "Build examples for OpenGL/X11 based platforms" OFF)
104 #===========================================================================================================
105 if (WITH_GLX_EXAMPLE)
106 add_subdirectory_once (LayerManagerUtils)
107 add_subdirectory_once (LayerManagerClient/ilmClient)
108 add_subdirectory_once (LayerManagerExamples/GLXApplicationExample)
109 endif(WITH_GLX_EXAMPLE)
111 #===========================================================================================================
112 build_flag (WITH_CLIENTEXAMPLES "Build examples for client library usage" ON)
113 #===========================================================================================================
114 if (WITH_CLIENTEXAMPLES)
115 add_subdirectory_once (LayerManagerUtils)
116 add_subdirectory_once (LayerManagerClient/ilmClient)
117 add_subdirectory_once (LayerManagerExamples/LayerManagerClientExample)
118 endif(WITH_CLIENTEXAMPLES)
120 #===========================================================================================================
121 build_flag (WITH_WL_EXAMPLE "Build examples for GLES/Wayland based platforms" OFF)
122 #===========================================================================================================
124 add_subdirectory_once (LayerManagerUtils)
125 add_subdirectory_once (LayerManagerClient/ilmClient)
126 add_subdirectory_once (LayerManagerExamples/EGLWLApplicationExample)
127 add_subdirectory_once (LayerManagerExamples/EGLWLMockNavigation)
128 add_subdirectory_once (LayerManagerExamples/WLChromakeyExample)
129 add_subdirectory_once (LayerManagerExamples/EGLWLInputEventExample)
130 endif(WITH_WL_EXAMPLE)
132 #===========================================================================================================
133 build_flag (WITH_CONTROL_BIN "Build LayerManagerControl binary" ON)
134 #===========================================================================================================
135 if (WITH_CONTROL_BIN)
136 add_subdirectory_once (LayerManagerUtils)
137 add_subdirectory_once (LayerManagerClient/ilmClient)
138 add_subdirectory_once (LayerManagerClient/ilmControl)
139 add_subdirectory_once (LayerManagerControl)
140 endif(WITH_CONTROL_BIN)
142 #===========================================================================================================
143 build_flag (WITH_EXAMPLE_SCENE_PROVIDER "Build scene provider plugin to run example applications" OFF)
144 #===========================================================================================================
145 if (WITH_EXAMPLE_SCENE_PROVIDER)
146 add_subdirectory_once (LayerManagerCommands)
147 add_subdirectory_once (LayerManagerBase)
148 add_subdirectory_once (LayerManagerPlugins/SceneProvider/ExampleSceneProvider)
149 endif(WITH_EXAMPLE_SCENE_PROVIDER)
151 #===========================================================================================================
152 build_flag (WITH_SYSTEMD_HEALTH_MONITOR "Build plugin for systemd based health monitoring" OFF)
153 #===========================================================================================================
154 if (WITH_SYSTEMD_HEALTH_MONITOR)
155 add_subdirectory_once (3rdParty/systemd)
156 add_subdirectory_once (LayerManagerUtils)
157 add_subdirectory_once (LayerManagerBase)
158 add_subdirectory_once (LayerManagerPlugins/HealthMonitor/SystemdHealthMonitor)
159 endif(WITH_SYSTEMD_HEALTH_MONITOR)
161 #===========================================================================================================
162 build_flag (WITH_GENERIC_COMMUNICATOR "Build Generic Communicator Plugin based on IpcModules" ON)
163 #===========================================================================================================
164 if (WITH_GENERIC_COMMUNICATOR)
165 add_subdirectory_once (LayerManagerUtils)
166 add_subdirectory_once (LayerManagerBase)
167 add_subdirectory_once (LayerManagerPlugins/IpcModules)
168 add_subdirectory_once (LayerManagerCommands)
169 add_subdirectory_once (LayerManagerPlugins/Communicators/GenericCommunicator)
170 endif(WITH_GENERIC_COMMUNICATOR)
172 #===========================================================================================================
173 build_flag (WITH_DESKTOP "Build renderer plugin for OpenGL/X11 based platforms" OFF)
174 #===========================================================================================================
176 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLX)
177 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/GLXRenderer)
180 #===========================================================================================================
181 build_flag (WITH_GLX_LIB "Build development library for OpenGL/X11 based renderers" OFF)
182 #===========================================================================================================
184 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLX)
187 #===========================================================================================================
188 build_flag (WITH_WAYLAND_X11 "Build renderer plugin for GLES/Wayland with X11 backend" OFF)
189 #===========================================================================================================
190 if (WITH_WAYLAND_X11)
191 add_subdirectory_once (LayerManagerUtils)
192 add_subdirectory_once (LayerManagerBase)
193 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandX11GLESv2)
194 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
195 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandX11GLESRenderer)
196 endif(WITH_WAYLAND_X11)
198 #===========================================================================================================
199 build_flag (WITH_WAYLAND_X11_LIB "Build development library for GLES/Wayland X11 based renderers" OFF)
200 #===========================================================================================================
201 if (WITH_WAYLAND_X11_LIB)
202 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandX11GLESv2)
203 endif(WITH_WAYLAND_X11_LIB)
205 #===========================================================================================================
206 build_flag (WITH_WAYLAND_DRM "Build renderer plugin for GLES/Wayland with DRM backend" OFF)
207 #===========================================================================================================
208 if (WITH_WAYLAND_DRM)
209 add_subdirectory_once (LayerManagerUtils)
210 add_subdirectory_once (LayerManagerBase)
211 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandDrmGLESv2)
212 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
213 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandDrmGLESRenderer)
214 endif(WITH_WAYLAND_DRM)
216 #===========================================================================================================
217 build_flag (WITH_WAYLAND_DRM_LIB "Build development library for GLES/Wayland DRM based renderers" OFF)
218 #===========================================================================================================
219 if (WITH_WAYLAND_DRM_LIB)
220 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandDrmGLESv2)
221 endif(WITH_WAYLAND_DRM_LIB)
223 #===========================================================================================================
224 build_flag (WITH_WAYLAND_FBDEV "Build renderer plugin for GLES/Wayland with FBDEV backend" OFF)
225 #===========================================================================================================
226 if (WITH_WAYLAND_FBDEV)
227 add_subdirectory_once (LayerManagerUtils)
228 add_subdirectory_once (LayerManagerBase)
229 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandFbdevGLESv2)
230 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
231 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandFbdevGLESRenderer)
232 endif(WITH_WAYLAND_FBDEV)
234 #===========================================================================================================
235 build_flag (WITH_WAYLAND_FBDEV_LIB "Build development library for GLES/Wayland FBDEV based renderers" OFF)
236 #===========================================================================================================
237 if (WITH_WAYLAND_FBDEV_LIB)
238 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandFbdevGLESv2)
239 endif(WITH_WAYLAND_FBDEV_LIB)
241 #===========================================================================================================
242 build_flag (WITH_X11_GLES "Build renderer plugin for GLES/X11 based platforms" ON)
243 #===========================================================================================================
245 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLESv2)
246 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/X11GLESRenderer)
249 #===========================================================================================================
250 build_flag (WITH_GLESv2_LIB "Build development library for GLES/X11 based renderers" OFF)
251 #===========================================================================================================
253 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLESv2)
254 endif(WITH_GLESv2_LIB)
256 #===========================================================================================================
257 build_flag (WITH_TEXT_RENDERER "Build renderer plugin with pure logging (no rendering)" OFF)
258 #===========================================================================================================
259 if (WITH_TEXT_RENDERER)
260 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/TextRenderer)
261 endif(WITH_TEXT_RENDERER)
263 #===========================================================================================================
264 build_flag (WITH_SERVICE_BIN "Build LayerManagerService binary" ON)
265 #===========================================================================================================
266 if (WITH_SERVICE_BIN)
267 add_subdirectory_once (LayerManagerUtils)
268 add_subdirectory_once (LayerManagerBase)
269 add_subdirectory_once (LayerManagerService)
270 endif (WITH_SERVICE_BIN)
272 #===========================================================================================================
273 build_flag (WITH_CLIENT_LIB "Build LayerManagement client library" ON)
274 #===========================================================================================================
276 add_subdirectory_once (LayerManagerUtils)
277 add_subdirectory_once (LayerManagerPlugins/IpcModules)
278 add_subdirectory_once (LayerManagerClient/ilmCommon)
279 add_subdirectory_once (LayerManagerClient/ilmClient)
280 endif (WITH_CLIENT_LIB)
282 #===========================================================================================================
283 build_flag (WITH_CONTROL_LIB "Build LayerManagement control library" ON)
284 #===========================================================================================================
285 if (WITH_CONTROL_LIB)
286 add_subdirectory_once (LayerManagerUtils)
287 add_subdirectory_once (LayerManagerPlugins/IpcModules)
288 add_subdirectory_once (LayerManagerClient/ilmCommon)
289 add_subdirectory_once (LayerManagerClient/ilmControl)
290 endif (WITH_CONTROL_LIB)
292 #===========================================================================================================
293 # store used build configuration
294 #===========================================================================================================
295 add_subdirectory_once(config)