CMake: added WITH_DOCUMENTATION build flag
[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_TESTS "Build unit test binaries for all enabled components" OFF)
72 #===========================================================================================================
73 if (WITH_TESTS)
74     # enable ctest if building with tests, run 'make test' after build to run all tests
75     # be aware that some tests require a running layermanager
76     enable_testing()
77     add_subdirectory_once (3rdParty/gtest)
78     add_subdirectory_once (3rdParty/gmock)
79 endif(WITH_TESTS)
80
81 #===========================================================================================================
82 build_flag (WITH_EGL_EXAMPLE "Build examples for GLES/X11 based platforms" ON)
83 #===========================================================================================================
84 if (WITH_EGL_EXAMPLE)
85     add_subdirectory_once (LayerManagerUtils)
86     add_subdirectory_once (LayerManagerClient/ilmClient)
87     add_subdirectory_once (LayerManagerClient/ilmControl)
88     add_subdirectory_once (LayerManagerExamples/EGLX11ApplicationExample)
89     add_subdirectory_once (LayerManagerExamples/EGLX11MockNavigation)
90 endif(WITH_EGL_EXAMPLE)
91
92 #===========================================================================================================
93 build_flag (WITH_GLX_EXAMPLE "Build examples for OpenGL/X11 based platforms" OFF)
94 #===========================================================================================================
95 if (WITH_GLX_EXAMPLE)
96     add_subdirectory_once (LayerManagerUtils)
97     add_subdirectory_once (LayerManagerClient/ilmClient)
98     add_subdirectory_once (LayerManagerExamples/GLXApplicationExample)
99 endif(WITH_GLX_EXAMPLE)
100
101 #===========================================================================================================
102 build_flag (WITH_CLIENTEXAMPLES "Build examples for client library usage" ON)
103 #===========================================================================================================
104 if (WITH_CLIENTEXAMPLES)
105     add_subdirectory_once (LayerManagerUtils)
106     add_subdirectory_once (LayerManagerClient/ilmClient)
107     add_subdirectory_once (LayerManagerExamples/LayerManagerClientExample)
108 endif(WITH_CLIENTEXAMPLES)
109
110 #===========================================================================================================
111 build_flag (WITH_WL_EXAMPLE "Build examples for GLES/Wayland based platforms" OFF)
112 #===========================================================================================================
113 if (WITH_WL_EXAMPLE)
114     add_subdirectory_once (LayerManagerUtils)
115     add_subdirectory_once (LayerManagerClient/ilmClient)
116     add_subdirectory_once (LayerManagerExamples/EGLWLApplicationExample)
117     add_subdirectory_once (LayerManagerExamples/EGLWLMockNavigation)
118     add_subdirectory_once (LayerManagerExamples/WLChromakeyExample)
119     add_subdirectory_once (LayerManagerExamples/EGLWLInputEventExample)
120 endif(WITH_WL_EXAMPLE)
121
122 #===========================================================================================================
123 build_flag (WITH_CONTROL_BIN "Build LayerManagerControl binary" ON)
124 #===========================================================================================================
125 if (WITH_CONTROL_BIN)
126     add_subdirectory_once (LayerManagerUtils)
127     add_subdirectory_once (LayerManagerClient/ilmClient)
128     add_subdirectory_once (LayerManagerClient/ilmControl)
129     add_subdirectory_once (LayerManagerControl)
130 endif(WITH_CONTROL_BIN)
131
132 #===========================================================================================================
133 build_flag (WITH_EXAMPLE_SCENE_PROVIDER "Build scene provider plugin to run example applications" OFF)
134 #===========================================================================================================
135 if (WITH_EXAMPLE_SCENE_PROVIDER)
136     add_subdirectory_once (LayerManagerCommands)
137     add_subdirectory_once (LayerManagerBase)
138     add_subdirectory_once (LayerManagerPlugins/SceneProvider/ExampleSceneProvider)
139 endif(WITH_EXAMPLE_SCENE_PROVIDER)
140
141 #===========================================================================================================
142 build_flag (WITH_SYSTEMD_HEALTH_MONITOR "Build plugin for systemd based health monitoring" OFF)
143 #===========================================================================================================
144 if (WITH_SYSTEMD_HEALTH_MONITOR)
145     add_subdirectory_once (3rdParty/systemd)
146     add_subdirectory_once (LayerManagerUtils)
147     add_subdirectory_once (LayerManagerBase)
148     add_subdirectory_once (LayerManagerPlugins/HealthMonitor/SystemdHealthMonitor)
149 endif(WITH_SYSTEMD_HEALTH_MONITOR)
150
151 #===========================================================================================================
152 build_flag (WITH_GENERIC_COMMUNICATOR "Build Generic Communicator Plugin based on IpcModules" ON)
153 #===========================================================================================================
154 if (WITH_GENERIC_COMMUNICATOR)
155     add_subdirectory_once (LayerManagerUtils)
156     add_subdirectory_once (LayerManagerBase)
157     add_subdirectory_once (LayerManagerPlugins/IpcModules)
158     add_subdirectory_once (LayerManagerCommands)
159     add_subdirectory_once (LayerManagerPlugins/Communicators/GenericCommunicator)
160 endif(WITH_GENERIC_COMMUNICATOR)
161
162 #===========================================================================================================
163 build_flag (WITH_DESKTOP "Build renderer plugin for OpenGL/X11 based platforms" OFF)
164 #===========================================================================================================
165 if (WITH_DESKTOP)
166     add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLX)
167     add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/GLXRenderer)
168 endif(WITH_DESKTOP)
169
170 #===========================================================================================================
171 build_flag (WITH_GLX_LIB "Build development library for OpenGL/X11 based renderers" OFF)
172 #===========================================================================================================
173 if (WITH_GLX_LIB)
174     add_subdirectory_once (LayerManagerPlugins/Renderers/Graphic)
175     add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLX)
176 endif(WITH_GLX_LIB)
177
178 #===========================================================================================================
179 build_flag (WITH_WAYLAND_X11 "Build renderer plugin for GLES/Wayland with X11 backend" OFF)
180 #===========================================================================================================
181 if (WITH_WAYLAND_X11)
182     add_subdirectory_once (LayerManagerUtils)
183     add_subdirectory_once (LayerManagerBase)
184     add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandX11GLESv2)
185     add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
186     add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandX11GLESRenderer)
187 endif(WITH_WAYLAND_X11)
188
189 #===========================================================================================================
190 build_flag (WITH_WAYLAND_X11_LIB "Build development library for GLES/Wayland X11 based renderers" OFF)
191 #===========================================================================================================
192 if (WITH_WAYLAND_X11_LIB)
193     add_subdirectory_once (LayerManagerPlugins/Renderers/Graphic)
194     add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandX11GLESv2)
195 endif(WITH_WAYLAND_X11_LIB)
196
197 #===========================================================================================================
198 build_flag (WITH_WAYLAND_DRM "Build renderer plugin for GLES/Wayland with DRM backend" OFF)
199 #===========================================================================================================
200 if (WITH_WAYLAND_DRM)
201     add_subdirectory_once (LayerManagerUtils)
202     add_subdirectory_once (LayerManagerBase)
203     add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandDrmGLESv2)
204     add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
205     add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandDrmGLESRenderer)
206 endif(WITH_WAYLAND_DRM)
207
208 #===========================================================================================================
209 build_flag (WITH_WAYLAND_DRM_LIB "Build development library for GLES/Wayland DRM based renderers" OFF)
210 #===========================================================================================================
211 if (WITH_WAYLAND_DRM_LIB)
212     add_subdirectory_once (LayerManagerPlugins/Renderers/Graphic)
213     add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandDrmGLESv2)
214 endif(WITH_WAYLAND_DRM_LIB)
215
216 #===========================================================================================================
217 build_flag (WITH_WAYLAND_FBDEV "Build renderer plugin for GLES/Wayland with FBDEV backend" OFF)
218 #===========================================================================================================
219 if (WITH_WAYLAND_FBDEV)
220     add_subdirectory_once (LayerManagerUtils)
221     add_subdirectory_once (LayerManagerBase)
222     add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandFbdevGLESv2)
223     add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
224     add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandFbdevGLESRenderer)
225 endif(WITH_WAYLAND_FBDEV)
226
227 #===========================================================================================================
228 build_flag (WITH_WAYLAND_FBDEV_LIB "Build development library for GLES/Wayland FBDEV based renderers" OFF)
229 #===========================================================================================================
230 if (WITH_WAYLAND_FBDEV_LIB)
231     add_subdirectory_once (LayerManagerPlugins/Renderers/Graphic)
232     add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandFbdevGLESv2)
233 endif(WITH_WAYLAND_FBDEV_LIB)
234
235 #===========================================================================================================
236 build_flag (WITH_X11_GLES "Build renderer plugin for GLES/X11 based platforms" ON)
237 #===========================================================================================================
238 if (WITH_X11_GLES)
239     add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLESv2)
240     add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/X11GLESRenderer)
241 endif(WITH_X11_GLES)
242
243 #===========================================================================================================
244 build_flag (WITH_GLESv2_LIB "Build development library for GLES/X11 based renderers" OFF)
245 #===========================================================================================================
246 if (WITH_GLESv2_LIB)
247     add_subdirectory_once (LayerManagerPlugins/Renderers/Graphic)
248     add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLESv2)
249 endif(WITH_GLESv2_LIB)
250
251 #===========================================================================================================
252 build_flag (WITH_TEXT_RENDERER "Build renderer plugin with pure logging (no rendering)" OFF)
253 #===========================================================================================================
254 if (WITH_TEXT_RENDERER)
255     add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/TextRenderer)
256 endif(WITH_TEXT_RENDERER)
257
258 #===========================================================================================================
259 build_flag (WITH_SERVICE_BIN "Build LayerManagerService binary" ON)
260 #===========================================================================================================
261 if (WITH_SERVICE_BIN)
262     add_subdirectory_once (LayerManagerUtils)
263     add_subdirectory_once (LayerManagerBase)
264     add_subdirectory_once (LayerManagerService)
265 endif (WITH_SERVICE_BIN)
266
267 #===========================================================================================================
268 build_flag (WITH_CLIENT_LIB "Build LayerManagement client library" ON)
269 #===========================================================================================================
270 if (WITH_CLIENT_LIB)
271     add_subdirectory_once (LayerManagerUtils)
272     add_subdirectory_once (LayerManagerPlugins/IpcModules)
273     add_subdirectory_once (LayerManagerClient/ilmCommon)
274     add_subdirectory_once (LayerManagerClient/ilmClient)
275 endif (WITH_CLIENT_LIB)
276
277 #===========================================================================================================
278 build_flag (WITH_CONTROL_LIB "Build LayerManagement control library" OFF)
279 #===========================================================================================================
280 if (WITH_CONTROL_LIB)
281     add_subdirectory_once (LayerManagerUtils)
282     add_subdirectory_once (LayerManagerPlugins/IpcModules)
283     add_subdirectory_once (LayerManagerClient/ilmCommon)
284     add_subdirectory_once (LayerManagerClient/ilmControl)
285 endif (WITH_CONTROL_LIB)
286
287 #===========================================================================================================
288 # store used build configuration
289 #===========================================================================================================
290 add_subdirectory_once(config)