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 (LayerManagerExamples/EGLX11ApplicationExample)
58 add_subdirectory_once (LayerManagerExamples/EGLX11MockNavigation)
59 endif(WITH_EGL_EXAMPLE)
61 #===========================================================================================================
62 build_flag (WITH_GLX_EXAMPLE "Build examples for OpenGL/X11 based platforms" OFF)
63 #===========================================================================================================
65 add_subdirectory_once (LayerManagerUtils)
66 add_subdirectory_once (LayerManagerClient/ilmClient)
67 add_subdirectory_once (LayerManagerExamples/GLXApplicationExample)
68 endif(WITH_GLX_EXAMPLE)
70 #===========================================================================================================
71 build_flag (WITH_CLIENTEXAMPLES "Build examples for client library usage" ON)
72 #===========================================================================================================
73 if (WITH_CLIENTEXAMPLES)
74 add_subdirectory_once (LayerManagerUtils)
75 add_subdirectory_once (LayerManagerClient/ilmClient)
76 add_subdirectory_once (LayerManagerExamples/LayerManagerClientExample)
77 endif(WITH_CLIENTEXAMPLES)
79 #===========================================================================================================
80 build_flag (WITH_WL_EXAMPLE "Build examples for GLES/Wayland based platforms" OFF)
81 #===========================================================================================================
83 add_subdirectory_once (LayerManagerUtils)
84 add_subdirectory_once (LayerManagerClient/ilmClient)
85 add_subdirectory_once (LayerManagerExamples/EGLWLApplicationExample)
86 add_subdirectory_once (LayerManagerExamples/EGLWLMockNavigation)
87 add_subdirectory_once (LayerManagerExamples/WLChromakeyExample)
88 add_subdirectory_once (LayerManagerExamples/EGLWLInputEventExample)
89 endif(WITH_WL_EXAMPLE)
91 #===========================================================================================================
92 build_flag (WITH_CONTROL_BIN "Build LayerManagerControl binary" ON)
93 #===========================================================================================================
95 add_subdirectory_once (LayerManagerUtils)
96 add_subdirectory_once (LayerManagerClient/ilmClient)
97 add_subdirectory_once (LayerManagerControl)
98 endif(WITH_CONTROL_BIN)
100 #===========================================================================================================
101 build_flag (WITH_EXAMPLE_SCENE_PROVIDER "Build scene provider plugin to run example applications" OFF)
102 #===========================================================================================================
103 if (WITH_EXAMPLE_SCENE_PROVIDER)
104 add_subdirectory_once (LayerManagerCommands)
105 add_subdirectory_once (LayerManagerBase)
106 add_subdirectory_once (LayerManagerPlugins/SceneProvider/ExampleSceneProvider)
107 endif(WITH_EXAMPLE_SCENE_PROVIDER)
109 #===========================================================================================================
110 build_flag (WITH_SYSTEMD_HEALTH_MONITOR "Build plugin for systemd based health monitoring" OFF)
111 #===========================================================================================================
112 if (WITH_SYSTEMD_HEALTH_MONITOR)
113 add_subdirectory_once (3rdParty/systemd)
114 add_subdirectory_once (LayerManagerUtils)
115 add_subdirectory_once (LayerManagerBase)
116 add_subdirectory_once (LayerManagerPlugins/HealthMonitor/SystemdHealthMonitor)
117 endif(WITH_SYSTEMD_HEALTH_MONITOR)
119 #===========================================================================================================
120 build_flag (WITH_GENERIC_COMMUNICATOR "Build Generic Communicator Plugin based on IpcModules" ON)
121 #===========================================================================================================
122 if (WITH_GENERIC_COMMUNICATOR)
123 add_subdirectory_once (LayerManagerPlugins/IpcModules)
124 add_subdirectory_once (LayerManagerCommands)
125 add_subdirectory_once (LayerManagerPlugins/Communicators/GenericCommunicator)
126 endif(WITH_GENERIC_COMMUNICATOR)
128 #===========================================================================================================
129 build_flag (WITH_DESKTOP "Build renderer plugin for OpenGL/X11 based platforms" OFF)
130 #===========================================================================================================
132 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLX)
133 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/GLXRenderer)
136 #===========================================================================================================
137 build_flag (WITH_GLX_LIB "Build development library for OpenGL/X11 based renderers" OFF)
138 #===========================================================================================================
140 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLX)
143 #===========================================================================================================
144 build_flag (WITH_WAYLAND_X11 "Build renderer plugin for GLES/Wayland with X11 backend" OFF)
145 #===========================================================================================================
146 if (WITH_WAYLAND_X11)
147 add_subdirectory_once (LayerManagerUtils)
148 add_subdirectory_once (LayerManagerBase)
149 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandX11GLESv2)
150 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
151 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandX11GLESRenderer)
152 endif(WITH_WAYLAND_X11)
154 #===========================================================================================================
155 build_flag (WITH_WAYLAND_X11_LIB "Build development library for GLES/Wayland X11 based renderers" OFF)
156 #===========================================================================================================
157 if (WITH_WAYLAND_X11_LIB)
158 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandX11GLESv2)
159 endif(WITH_WAYLAND_X11_LIB)
161 #===========================================================================================================
162 build_flag (WITH_WAYLAND_DRM "Build renderer plugin for GLES/Wayland with DRM backend" OFF)
163 #===========================================================================================================
164 if (WITH_WAYLAND_DRM)
165 add_subdirectory_once (LayerManagerUtils)
166 add_subdirectory_once (LayerManagerBase)
167 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandDrmGLESv2)
168 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
169 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandDrmGLESRenderer)
170 endif(WITH_WAYLAND_DRM)
172 #===========================================================================================================
173 build_flag (WITH_WAYLAND_DRM_LIB "Build development library for GLES/Wayland DRM based renderers" OFF)
174 #===========================================================================================================
175 if (WITH_WAYLAND_DRM_LIB)
176 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandDrmGLESv2)
177 endif(WITH_WAYLAND_DRM_LIB)
179 #===========================================================================================================
180 build_flag (WITH_WAYLAND_FBDEV "Build renderer plugin for GLES/Wayland with FBDEV backend" OFF)
181 #===========================================================================================================
182 if (WITH_WAYLAND_FBDEV)
183 add_subdirectory_once (LayerManagerUtils)
184 add_subdirectory_once (LayerManagerBase)
185 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandFbdevGLESv2)
186 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
187 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandFbdevGLESRenderer)
188 endif(WITH_WAYLAND_FBDEV)
190 #===========================================================================================================
191 build_flag (WITH_WAYLAND_FBDEV_LIB "Build development library for GLES/Wayland FBDEV based renderers" OFF)
192 #===========================================================================================================
193 if (WITH_WAYLAND_FBDEV_LIB)
194 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandFbdevGLESv2)
195 endif(WITH_WAYLAND_FBDEV_LIB)
197 #===========================================================================================================
198 build_flag (WITH_X11_GLES "Build renderer plugin for GLES/X11 based platforms" ON)
199 #===========================================================================================================
201 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLESv2)
202 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/X11GLESRenderer)
205 #===========================================================================================================
206 build_flag (WITH_GLESv2_LIB "Build development library for GLES/X11 based renderers" OFF)
207 #===========================================================================================================
209 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLESv2)
210 endif(WITH_GLESv2_LIB)
212 #===========================================================================================================
213 build_flag (WITH_TEXT_RENDERER "Build renderer plugin with pure logging (no rendering)" OFF)
214 #===========================================================================================================
215 if (WITH_TEXT_RENDERER)
216 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/TextRenderer)
217 endif(WITH_TEXT_RENDERER)
219 #===========================================================================================================
220 build_flag (WITH_SERVICE_BIN "Build LayerManagerService binary" ON)
221 #===========================================================================================================
222 if (WITH_SERVICE_BIN)
223 add_subdirectory_once (LayerManagerUtils)
224 add_subdirectory_once (LayerManagerBase)
225 add_subdirectory_once (LayerManagerService)
226 endif (WITH_SERVICE_BIN)
228 #===========================================================================================================
229 build_flag (WITH_CLIENT_LIB "Build LayerManagement client library" ON)
230 #===========================================================================================================
232 add_subdirectory_once (LayerManagerPlugins/IpcModules)
233 add_subdirectory_once (LayerManagerClient/ilmClient)
234 endif (WITH_CLIENT_LIB)
236 #===========================================================================================================
237 # store used build configuration
238 #===========================================================================================================
239 add_subdirectory_once(config)