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_MODULE_PATH}/DefaultSettings.txt)
29 include(${CMAKE_MODULE_PATH}/CMakeVersions.txt)
30 include(${CMAKE_MODULE_PATH}/CustomMacros.txt)
31 add_subdirectory(cmake/optionalFeatures)
33 #===========================================================================================================
35 #===========================================================================================================
36 build_flag (WITH_FORCE_COPY "Force Software Copy of Pixmaps (compatibility for VMs)" OFF)
37 build_flag (WITH_DLT "Build with DLT logging support" OFF)
38 build_flag (WITH_STATIC_LIBRARIES "Link all plugins and libraries statically" OFF)
40 #===========================================================================================================
41 build_flag (WITH_TESTS "Build unit test binaries for all enabled components" OFF)
42 #===========================================================================================================
44 # enable ctest if building with tests, run 'make test' after build to run all tests
45 # be aware that some tests require a running layermanager
47 add_subdirectory_once (3rdParty/gtest)
48 add_subdirectory_once (3rdParty/gmock)
51 #===========================================================================================================
52 build_flag (WITH_EGL_EXAMPLE "Build examples for GLES/X11 based platforms" ON)
53 #===========================================================================================================
55 add_subdirectory_once (LayerManagerUtils)
56 add_subdirectory_once (LayerManagerClient/ilmClient)
57 add_subdirectory_once (LayerManagerClient/ilmControl)
58 add_subdirectory_once (LayerManagerExamples/EGLX11ApplicationExample)
59 add_subdirectory_once (LayerManagerExamples/EGLX11MockNavigation)
60 endif(WITH_EGL_EXAMPLE)
62 #===========================================================================================================
63 build_flag (WITH_GLX_EXAMPLE "Build examples for OpenGL/X11 based platforms" OFF)
64 #===========================================================================================================
66 add_subdirectory_once (LayerManagerUtils)
67 add_subdirectory_once (LayerManagerClient/ilmClient)
68 add_subdirectory_once (LayerManagerExamples/GLXApplicationExample)
69 endif(WITH_GLX_EXAMPLE)
71 #===========================================================================================================
72 build_flag (WITH_CLIENTEXAMPLES "Build examples for client library usage" ON)
73 #===========================================================================================================
74 if (WITH_CLIENTEXAMPLES)
75 add_subdirectory_once (LayerManagerUtils)
76 add_subdirectory_once (LayerManagerClient/ilmClient)
77 add_subdirectory_once (LayerManagerExamples/LayerManagerClientExample)
78 endif(WITH_CLIENTEXAMPLES)
80 #===========================================================================================================
81 build_flag (WITH_WL_EXAMPLE "Build examples for GLES/Wayland based platforms" OFF)
82 #===========================================================================================================
84 add_subdirectory_once (LayerManagerUtils)
85 add_subdirectory_once (LayerManagerClient/ilmClient)
86 add_subdirectory_once (LayerManagerExamples/EGLWLApplicationExample)
87 add_subdirectory_once (LayerManagerExamples/EGLWLMockNavigation)
88 add_subdirectory_once (LayerManagerExamples/WLChromakeyExample)
89 add_subdirectory_once (LayerManagerExamples/EGLWLInputEventExample)
90 endif(WITH_WL_EXAMPLE)
92 #===========================================================================================================
93 build_flag (WITH_CONTROL_BIN "Build LayerManagerControl binary" ON)
94 #===========================================================================================================
96 add_subdirectory_once (LayerManagerUtils)
97 add_subdirectory_once (LayerManagerClient/ilmClient)
98 add_subdirectory_once (LayerManagerClient/ilmControl)
99 add_subdirectory_once (LayerManagerControl)
100 endif(WITH_CONTROL_BIN)
102 #===========================================================================================================
103 build_flag (WITH_EXAMPLE_SCENE_PROVIDER "Build scene provider plugin to run example applications" OFF)
104 #===========================================================================================================
105 if (WITH_EXAMPLE_SCENE_PROVIDER)
106 add_subdirectory_once (LayerManagerCommands)
107 add_subdirectory_once (LayerManagerBase)
108 add_subdirectory_once (LayerManagerPlugins/SceneProvider/ExampleSceneProvider)
109 endif(WITH_EXAMPLE_SCENE_PROVIDER)
111 #===========================================================================================================
112 build_flag (WITH_SYSTEMD_HEALTH_MONITOR "Build plugin for systemd based health monitoring" OFF)
113 #===========================================================================================================
114 if (WITH_SYSTEMD_HEALTH_MONITOR)
115 add_subdirectory_once (3rdParty/systemd)
116 add_subdirectory_once (LayerManagerUtils)
117 add_subdirectory_once (LayerManagerBase)
118 add_subdirectory_once (LayerManagerPlugins/HealthMonitor/SystemdHealthMonitor)
119 endif(WITH_SYSTEMD_HEALTH_MONITOR)
121 #===========================================================================================================
122 build_flag (WITH_GENERIC_COMMUNICATOR "Build Generic Communicator Plugin based on IpcModules" ON)
123 #===========================================================================================================
124 if (WITH_GENERIC_COMMUNICATOR)
125 add_subdirectory_once (LayerManagerPlugins/IpcModules)
126 add_subdirectory_once (LayerManagerCommands)
127 add_subdirectory_once (LayerManagerPlugins/Communicators/GenericCommunicator)
128 endif(WITH_GENERIC_COMMUNICATOR)
130 #===========================================================================================================
131 build_flag (WITH_DESKTOP "Build renderer plugin for OpenGL/X11 based platforms" OFF)
132 #===========================================================================================================
134 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLX)
135 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/GLXRenderer)
138 #===========================================================================================================
139 build_flag (WITH_GLX_LIB "Build development library for OpenGL/X11 based renderers" OFF)
140 #===========================================================================================================
142 add_subdirectory_once (LayerManagerPlugins/Renderers/Graphic)
143 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLX)
146 #===========================================================================================================
147 build_flag (WITH_WAYLAND_X11 "Build renderer plugin for GLES/Wayland with X11 backend" OFF)
148 #===========================================================================================================
149 if (WITH_WAYLAND_X11)
150 add_subdirectory_once (LayerManagerUtils)
151 add_subdirectory_once (LayerManagerBase)
152 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandX11GLESv2)
153 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
154 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandX11GLESRenderer)
155 endif(WITH_WAYLAND_X11)
157 #===========================================================================================================
158 build_flag (WITH_WAYLAND_X11_LIB "Build development library for GLES/Wayland X11 based renderers" OFF)
159 #===========================================================================================================
160 if (WITH_WAYLAND_X11_LIB)
161 add_subdirectory_once (LayerManagerPlugins/Renderers/Graphic)
162 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandX11GLESv2)
163 endif(WITH_WAYLAND_X11_LIB)
165 #===========================================================================================================
166 build_flag (WITH_WAYLAND_DRM "Build renderer plugin for GLES/Wayland with DRM backend" OFF)
167 #===========================================================================================================
168 if (WITH_WAYLAND_DRM)
169 add_subdirectory_once (LayerManagerUtils)
170 add_subdirectory_once (LayerManagerBase)
171 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandDrmGLESv2)
172 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
173 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandDrmGLESRenderer)
174 endif(WITH_WAYLAND_DRM)
176 #===========================================================================================================
177 build_flag (WITH_WAYLAND_DRM_LIB "Build development library for GLES/Wayland DRM based renderers" OFF)
178 #===========================================================================================================
179 if (WITH_WAYLAND_DRM_LIB)
180 add_subdirectory_once (LayerManagerPlugins/Renderers/Graphic)
181 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandDrmGLESv2)
182 endif(WITH_WAYLAND_DRM_LIB)
184 #===========================================================================================================
185 build_flag (WITH_WAYLAND_FBDEV "Build renderer plugin for GLES/Wayland with FBDEV backend" OFF)
186 #===========================================================================================================
187 if (WITH_WAYLAND_FBDEV)
188 add_subdirectory_once (LayerManagerUtils)
189 add_subdirectory_once (LayerManagerBase)
190 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandFbdevGLESv2)
191 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
192 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandFbdevGLESRenderer)
193 endif(WITH_WAYLAND_FBDEV)
195 #===========================================================================================================
196 build_flag (WITH_WAYLAND_FBDEV_LIB "Build development library for GLES/Wayland FBDEV based renderers" OFF)
197 #===========================================================================================================
198 if (WITH_WAYLAND_FBDEV_LIB)
199 add_subdirectory_once (LayerManagerPlugins/Renderers/Graphic)
200 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandFbdevGLESv2)
201 endif(WITH_WAYLAND_FBDEV_LIB)
203 #===========================================================================================================
204 build_flag (WITH_X11_GLES "Build renderer plugin for GLES/X11 based platforms" ON)
205 #===========================================================================================================
207 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLESv2)
208 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/X11GLESRenderer)
211 #===========================================================================================================
212 build_flag (WITH_GLESv2_LIB "Build development library for GLES/X11 based renderers" OFF)
213 #===========================================================================================================
215 add_subdirectory_once (LayerManagerPlugins/Renderers/Graphic)
216 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLESv2)
217 endif(WITH_GLESv2_LIB)
219 #===========================================================================================================
220 build_flag (WITH_TEXT_RENDERER "Build renderer plugin with pure logging (no rendering)" OFF)
221 #===========================================================================================================
222 if (WITH_TEXT_RENDERER)
223 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/TextRenderer)
224 endif(WITH_TEXT_RENDERER)
226 #===========================================================================================================
227 build_flag (WITH_SERVICE_BIN "Build LayerManagerService binary" ON)
228 #===========================================================================================================
229 if (WITH_SERVICE_BIN)
230 add_subdirectory_once (LayerManagerUtils)
231 add_subdirectory_once (LayerManagerBase)
232 add_subdirectory_once (LayerManagerService)
233 endif (WITH_SERVICE_BIN)
235 #===========================================================================================================
236 build_flag (WITH_CLIENT_LIB "Build LayerManagement client library" ON)
237 #===========================================================================================================
239 add_subdirectory_once (LayerManagerUtils)
240 add_subdirectory_once (LayerManagerPlugins/IpcModules)
241 add_subdirectory_once (LayerManagerClient/ilmCommon)
242 add_subdirectory_once (LayerManagerClient/ilmClient)
243 endif (WITH_CLIENT_LIB)
245 #===========================================================================================================
246 build_flag (WITH_CONTROL_LIB "Build LayerManagement control library" OFF)
247 #===========================================================================================================
248 if (WITH_CONTROL_LIB)
249 add_subdirectory_once (LayerManagerUtils)
250 add_subdirectory_once (LayerManagerPlugins/IpcModules)
251 add_subdirectory_once (LayerManagerClient/ilmCommon)
252 add_subdirectory_once (LayerManagerClient/ilmControl)
253 endif (WITH_CONTROL_LIB)
255 #===========================================================================================================
256 # store used build configuration
257 #===========================================================================================================
258 add_subdirectory_once(config)