Doc: updated specification version, report errors during PDF creation
[profile/ivi/layer-management.git] / CMakeLists.txt
1 ############################################################################
2
3 # Copyright 2010-2012 BMW Car IT GmbH  
4 # Copyright (C) 2011 DENSO CORPORATION and Robert Bosch Car Multimedia Gmbh
5
6
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 
10 #
11 #       http://www.apache.org/licenses/LICENSE-2.0 
12 #
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.
18 #
19 ############################################################################
20
21 cmake_minimum_required (VERSION 2.6)
22 project (LayerManager)
23
24 #===========================================================================================================
25 # cmake configuration
26 #===========================================================================================================
27 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")
28 include(${CMAKE_MODULE_PATH}/DefaultSettings.txt)
29 include(${CMAKE_MODULE_PATH}/CMakeVersions.txt)
30 include(${CMAKE_MODULE_PATH}/CustomMacros.txt)
31 add_subdirectory(cmake/optionalFeatures)
32
33 #===========================================================================================================
34 build_flag (WITH_FORCE_COPY "Force Software Copy of Pixmaps (compatibility for VMs)" OFF)
35 #===========================================================================================================
36 # no dedicated actions required here
37
38 #===========================================================================================================
39 build_flag (WITH_DLT "Build with DLT logging support" OFF)
40 #===========================================================================================================
41 # no dedicated actions required here
42
43 #===========================================================================================================
44 build_flag (WITH_STATIC_LIBRARIES "Link all plugins and libraries statically" OFF)
45 #===========================================================================================================
46 # no dedicated actions required here
47
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}; echo 'Checking style...<SOURCE>'; ${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)
56
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)
65     add_custom_target(doc
66                       COMMAND ${CMAKE_SOURCE_DIR}/generate_specification.sh
67                       WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
68 endif (WITH_DOCUMENTATION)
69
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 #===========================================================================================================
74 if (WITH_CPPCHECK)
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}")
77 endif (WITH_CPPCHECK)
78 add_custom_target(cppcheck COMMAND cppcheck ${CMAKE_SOURCE_DIR}/LayerManager*/ ${CPPCHECK_CONFIG})
79
80 #===========================================================================================================
81 build_flag (WITH_TESTS "Build unit test binaries for all enabled components" OFF)
82 #===========================================================================================================
83 if (WITH_TESTS)
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
86     enable_testing()
87     add_subdirectory_once (3rdParty/gtest)
88     add_subdirectory_once (3rdParty/gmock)
89 endif(WITH_TESTS)
90
91 #===========================================================================================================
92 build_flag (WITH_EGL_EXAMPLE "Build examples for GLES/X11 based platforms" ON)
93 #===========================================================================================================
94 if (WITH_EGL_EXAMPLE)
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)
101
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)
110
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)
119
120 #===========================================================================================================
121 build_flag (WITH_WL_EXAMPLE "Build examples for GLES/Wayland based platforms" OFF)
122 #===========================================================================================================
123 if (WITH_WL_EXAMPLE)
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)
131
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)
141
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)
150
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)
160
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)
171
172 #===========================================================================================================
173 build_flag (WITH_DESKTOP "Build renderer plugin for OpenGL/X11 based platforms" OFF)
174 #===========================================================================================================
175 if (WITH_DESKTOP)
176     add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLX)
177     add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/GLXRenderer)
178 endif(WITH_DESKTOP)
179
180 #===========================================================================================================
181 build_flag (WITH_GLX_LIB "Build development library for OpenGL/X11 based renderers" OFF)
182 #===========================================================================================================
183 if (WITH_GLX_LIB)
184     add_subdirectory_once (LayerManagerPlugins/Renderers/Graphic)
185     add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLX)
186 endif(WITH_GLX_LIB)
187
188 #===========================================================================================================
189 build_flag (WITH_WAYLAND_X11 "Build renderer plugin for GLES/Wayland with X11 backend" OFF)
190 #===========================================================================================================
191 if (WITH_WAYLAND_X11)
192     add_subdirectory_once (LayerManagerUtils)
193     add_subdirectory_once (LayerManagerBase)
194     add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandX11GLESv2)
195     add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
196     add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandX11GLESRenderer)
197 endif(WITH_WAYLAND_X11)
198
199 #===========================================================================================================
200 build_flag (WITH_WAYLAND_X11_LIB "Build development library for GLES/Wayland X11 based renderers" OFF)
201 #===========================================================================================================
202 if (WITH_WAYLAND_X11_LIB)
203     add_subdirectory_once (LayerManagerPlugins/Renderers/Graphic)
204     add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandX11GLESv2)
205 endif(WITH_WAYLAND_X11_LIB)
206
207 #===========================================================================================================
208 build_flag (WITH_WAYLAND_DRM "Build renderer plugin for GLES/Wayland with DRM backend" OFF)
209 #===========================================================================================================
210 if (WITH_WAYLAND_DRM)
211     add_subdirectory_once (LayerManagerUtils)
212     add_subdirectory_once (LayerManagerBase)
213     add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandDrmGLESv2)
214     add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
215     add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandDrmGLESRenderer)
216 endif(WITH_WAYLAND_DRM)
217
218 #===========================================================================================================
219 build_flag (WITH_WAYLAND_DRM_LIB "Build development library for GLES/Wayland DRM based renderers" OFF)
220 #===========================================================================================================
221 if (WITH_WAYLAND_DRM_LIB)
222     add_subdirectory_once (LayerManagerPlugins/Renderers/Graphic)
223     add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandDrmGLESv2)
224 endif(WITH_WAYLAND_DRM_LIB)
225
226 #===========================================================================================================
227 build_flag (WITH_WAYLAND_FBDEV "Build renderer plugin for GLES/Wayland with FBDEV backend" OFF)
228 #===========================================================================================================
229 if (WITH_WAYLAND_FBDEV)
230     add_subdirectory_once (LayerManagerUtils)
231     add_subdirectory_once (LayerManagerBase)
232     add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandFbdevGLESv2)
233     add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
234     add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandFbdevGLESRenderer)
235 endif(WITH_WAYLAND_FBDEV)
236
237 #===========================================================================================================
238 build_flag (WITH_WAYLAND_FBDEV_LIB "Build development library for GLES/Wayland FBDEV based renderers" OFF)
239 #===========================================================================================================
240 if (WITH_WAYLAND_FBDEV_LIB)
241     add_subdirectory_once (LayerManagerPlugins/Renderers/Graphic)
242     add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandFbdevGLESv2)
243 endif(WITH_WAYLAND_FBDEV_LIB)
244
245 #===========================================================================================================
246 build_flag (WITH_X11_GLES "Build renderer plugin for GLES/X11 based platforms" ON)
247 #===========================================================================================================
248 if (WITH_X11_GLES)
249     add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLESv2)
250     add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/X11GLESRenderer)
251 endif(WITH_X11_GLES)
252
253 #===========================================================================================================
254 build_flag (WITH_GLESv2_LIB "Build development library for GLES/X11 based renderers" OFF)
255 #===========================================================================================================
256 if (WITH_GLESv2_LIB)
257     add_subdirectory_once (LayerManagerPlugins/Renderers/Graphic)
258     add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLESv2)
259 endif(WITH_GLESv2_LIB)
260
261 #===========================================================================================================
262 build_flag (WITH_TEXT_RENDERER "Build renderer plugin with pure logging (no rendering)" OFF)
263 #===========================================================================================================
264 if (WITH_TEXT_RENDERER)
265     add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/TextRenderer)
266 endif(WITH_TEXT_RENDERER)
267
268 #===========================================================================================================
269 build_flag (WITH_SERVICE_BIN "Build LayerManagerService binary" ON)
270 #===========================================================================================================
271 if (WITH_SERVICE_BIN)
272     add_subdirectory_once (LayerManagerUtils)
273     add_subdirectory_once (LayerManagerBase)
274     add_subdirectory_once (LayerManagerService)
275 endif (WITH_SERVICE_BIN)
276
277 #===========================================================================================================
278 build_flag (WITH_CLIENT_LIB "Build LayerManagement client library" ON)
279 #===========================================================================================================
280 if (WITH_CLIENT_LIB)
281     add_subdirectory_once (LayerManagerUtils)
282     add_subdirectory_once (LayerManagerPlugins/IpcModules)
283     add_subdirectory_once (LayerManagerClient/ilmCommon)
284     add_subdirectory_once (LayerManagerClient/ilmClient)
285 endif (WITH_CLIENT_LIB)
286
287 #===========================================================================================================
288 build_flag (WITH_CONTROL_LIB "Build LayerManagement control library" OFF)
289 #===========================================================================================================
290 if (WITH_CONTROL_LIB)
291     add_subdirectory_once (LayerManagerUtils)
292     add_subdirectory_once (LayerManagerPlugins/IpcModules)
293     add_subdirectory_once (LayerManagerClient/ilmCommon)
294     add_subdirectory_once (LayerManagerClient/ilmControl)
295 endif (WITH_CONTROL_LIB)
296
297 #===========================================================================================================
298 # store used build configuration
299 #===========================================================================================================
300 add_subdirectory_once(config)
301