Examples: updated according to ilmClient split
[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 # global build flags
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)
39
40 #===========================================================================================================
41 build_flag (WITH_TESTS "Build unit test binaries for all enabled components" OFF)
42 #===========================================================================================================
43 if (WITH_TESTS)
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
46     enable_testing()
47     add_subdirectory_once (3rdParty/gtest)
48     add_subdirectory_once (3rdParty/gmock)
49 endif(WITH_TESTS)
50
51 #===========================================================================================================
52 build_flag (WITH_EGL_EXAMPLE "Build examples for GLES/X11 based platforms" ON)
53 #===========================================================================================================
54 if (WITH_EGL_EXAMPLE)
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)
61
62 #===========================================================================================================
63 build_flag (WITH_GLX_EXAMPLE "Build examples for OpenGL/X11 based platforms" OFF)
64 #===========================================================================================================
65 if (WITH_GLX_EXAMPLE)
66     add_subdirectory_once (LayerManagerUtils)
67     add_subdirectory_once (LayerManagerClient/ilmClient)
68     add_subdirectory_once (LayerManagerExamples/GLXApplicationExample)
69 endif(WITH_GLX_EXAMPLE)
70
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)
79
80 #===========================================================================================================
81 build_flag (WITH_WL_EXAMPLE "Build examples for GLES/Wayland based platforms" OFF)
82 #===========================================================================================================
83 if (WITH_WL_EXAMPLE)
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)
91
92 #===========================================================================================================
93 build_flag (WITH_CONTROL_BIN "Build LayerManagerControl binary" ON)
94 #===========================================================================================================
95 if (WITH_CONTROL_BIN)
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)
101
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)
110
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)
120
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)
129
130 #===========================================================================================================
131 build_flag (WITH_DESKTOP "Build renderer plugin for OpenGL/X11 based platforms" OFF)
132 #===========================================================================================================
133 if (WITH_DESKTOP)
134     add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLX)
135     add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/GLXRenderer)
136 endif(WITH_DESKTOP)
137
138 #===========================================================================================================
139 build_flag (WITH_GLX_LIB "Build development library for OpenGL/X11 based renderers" OFF)
140 #===========================================================================================================
141 if (WITH_GLX_LIB)
142     add_subdirectory_once (LayerManagerPlugins/Renderers/Graphic)
143     add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLX)
144 endif(WITH_GLX_LIB)
145
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)
156
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)
164
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)
175
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)
183
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)
194
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)
202
203 #===========================================================================================================
204 build_flag (WITH_X11_GLES "Build renderer plugin for GLES/X11 based platforms" ON)
205 #===========================================================================================================
206 if (WITH_X11_GLES)
207     add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLESv2)
208     add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/X11GLESRenderer)
209 endif(WITH_X11_GLES)
210
211 #===========================================================================================================
212 build_flag (WITH_GLESv2_LIB "Build development library for GLES/X11 based renderers" OFF)
213 #===========================================================================================================
214 if (WITH_GLESv2_LIB)
215     add_subdirectory_once (LayerManagerPlugins/Renderers/Graphic)
216     add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLESv2)
217 endif(WITH_GLESv2_LIB)
218
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)
225
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)
234
235 #===========================================================================================================
236 build_flag (WITH_CLIENT_LIB "Build LayerManagement client library" ON)
237 #===========================================================================================================
238 if (WITH_CLIENT_LIB)
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)
244
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)
254
255 #===========================================================================================================
256 # store used build configuration
257 #===========================================================================================================
258 add_subdirectory_once(config)