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 #==============================================================================
34 # Platforms / A set of indiviual options at once
35 #==============================================================================
36 option (WITH_X11_GLES "Build for X11 with GLES 2.0" ON )
37 option (WITH_GLESv2_LIB "Build development library for GLES2 Based Renderers" OFF)
38 option (WITH_EGL_EXAMPLE "Build EGL_EXAMPLE / X11" ON )
39 option (WITH_WL_EXAMPLE "Build EGL_EXAMPLE / Wayland" OFF)
40 option (WITH_DESKTOP "Build for Desktop / GLX" OFF)
41 option (WITH_GLX_LIB "Build development library for GLX Based Renderers" OFF)
42 option (WITH_GLX_EXAMPLE "Build GLX_EXAMPLE " OFF)
43 option (WITH_FORCE_COPY "Force Software Copy of Pixmaps" OFF)
44 option (WITH_CLIENTEXAMPLES "Build client examples " ON )
45 option (WITH_TESTS "Build Available Tests " OFF)
46 option (WITH_DLT "Build with DLT support " OFF)
47 option (WITH_WAYLAND_FBDEV "Build Wayland with FBDEV backend" OFF)
48 option (WITH_WAYLAND_FBDEV_LIB "Build development library for Wayland FBDEV Based Renderers" OFF)
49 option (WITH_WAYLAND_X11 "Build Wayland with X11 backend" OFF)
50 option (WITH_WAYLAND_X11_LIB "Build development library for Wayland X11 Based Renderers" OFF)
51 option (WITH_WAYLAND_DRM "Build Wayland with drm backend" OFF)
52 option (WITH_WAYLAND_DRM_LIB "Build development library for Wayland DRM Based Renderers" OFF)
53 option (WITH_SERVICE_BIN "Build LayerManagerService Binary" ON)
54 option (WITH_CONTROL_BIN "Build LayerManagerControl Binary" ON)
55 option (WITH_CLIENT_LIB "Build LayerManagement Client Lib" ON)
56 option (WITH_GENERIC_COMMUNICATOR "Build Generic Communicator Plugin" ON)
57 option (WITH_SYSTEMD_HEALTH_MONITOR "Build plugin for systemd health monitoring" OFF)
58 option (WITH_EXAMPLE_SCENE_PROVIDER "Build scene provider plugin for examples" OFF)
59 option (WITH_STATIC_LIBRARIES "Link all libraries statically" OFF)
60 option (WITH_TEXT_RENDERER "Build text renderer (only logging)" OFF)
62 #==============================================================================
63 # enable ctest if building with tests
64 # run 'make test' after build to run all tests
65 # be aware that some tests require a running layermanager
66 #==============================================================================
69 add_subdirectory_once (3rdParty/gtest)
70 add_subdirectory_once (3rdParty/gmock)
73 #==============================================================================
74 # use strict compiler settings for examples and tools
75 #------------------------------------------------------------------------------
76 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
77 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
78 #==============================================================================
81 add_subdirectory_once (LayerManagerUtils)
82 add_subdirectory_once (LayerManagerClient/ilmClient)
83 add_subdirectory_once (LayerManagerExamples/EGLX11ApplicationExample)
84 add_subdirectory_once (LayerManagerExamples/EGLX11MockNavigation)
85 endif(WITH_EGL_EXAMPLE)
88 add_subdirectory_once (LayerManagerUtils)
89 add_subdirectory_once (LayerManagerClient/ilmClient)
90 add_subdirectory_once (LayerManagerExamples/GLXApplicationExample)
91 endif(WITH_GLX_EXAMPLE)
93 if (WITH_CLIENTEXAMPLES)
94 add_subdirectory_once (LayerManagerUtils)
95 add_subdirectory_once (LayerManagerClient/ilmClient)
96 add_subdirectory_once (LayerManagerExamples/LayerManagerClientExample)
97 endif(WITH_CLIENTEXAMPLES)
100 add_subdirectory_once (LayerManagerUtils)
101 add_subdirectory_once (LayerManagerClient/ilmClient)
102 add_subdirectory_once (LayerManagerExamples/EGLWLApplicationExample)
103 add_subdirectory_once (LayerManagerExamples/EGLWLMockNavigation)
104 add_subdirectory_once (LayerManagerExamples/WLChromakeyExample)
105 add_subdirectory_once (LayerManagerExamples/EGLWLInputEventExample)
106 endif(WITH_WL_EXAMPLE)
108 if (WITH_CONTROL_BIN)
109 add_subdirectory_once (LayerManagerUtils)
110 add_subdirectory_once (LayerManagerClient/ilmClient)
111 add_subdirectory_once (LayerManagerControl)
112 endif(WITH_CONTROL_BIN)
114 #==============================================================================
115 # use very strict compiler settings for internal components
116 #------------------------------------------------------------------------------
117 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wno-long-long")
118 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-function")
119 #set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
120 #==============================================================================
122 if (WITH_EXAMPLE_SCENE_PROVIDER)
123 add_subdirectory_once (LayerManagerCommands)
124 add_subdirectory_once (LayerManagerBase)
125 add_subdirectory_once (LayerManagerPlugins/SceneProvider/ExampleSceneProvider)
126 endif(WITH_EXAMPLE_SCENE_PROVIDER)
128 if (WITH_SYSTEMD_HEALTH_MONITOR)
129 add_subdirectory_once (3rdParty/systemd)
130 add_subdirectory_once (LayerManagerUtils)
131 add_subdirectory_once (LayerManagerBase)
132 add_subdirectory_once (LayerManagerPlugins/HealthMonitor/SystemdHealthMonitor)
133 endif(WITH_SYSTEMD_HEALTH_MONITOR)
135 if (WITH_GENERIC_COMMUNICATOR)
136 add_subdirectory_once (LayerManagerPlugins/IpcModules)
137 add_subdirectory_once (LayerManagerCommands)
138 add_subdirectory_once (LayerManagerPlugins/Communicators/GenericCommunicator)
139 endif(WITH_GENERIC_COMMUNICATOR)
142 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLX)
143 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/GLXRenderer)
147 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLX)
150 if (WITH_WAYLAND_X11)
151 add_subdirectory_once (LayerManagerUtils)
152 add_subdirectory_once (LayerManagerBase)
153 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandX11GLESv2)
154 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
155 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandX11GLESRenderer)
156 endif(WITH_WAYLAND_X11)
158 if (WITH_WAYLAND_X11_LIB)
159 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandX11GLESv2)
160 endif(WITH_WAYLAND_X11_LIB)
162 if (WITH_WAYLAND_DRM)
163 add_subdirectory_once (LayerManagerUtils)
164 add_subdirectory_once (LayerManagerBase)
165 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandDrmGLESv2)
166 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
167 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandDrmGLESRenderer)
168 endif(WITH_WAYLAND_DRM)
170 if (WITH_WAYLAND_DRM_LIB)
171 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandDrmGLESv2)
172 endif(WITH_WAYLAND_DRM_LIB)
174 if (WITH_WAYLAND_FBDEV)
175 add_subdirectory_once (LayerManagerUtils)
176 add_subdirectory_once (LayerManagerBase)
177 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandFbdevGLESv2)
178 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
179 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/WaylandFbdevGLESRenderer)
180 endif(WITH_WAYLAND_FBDEV)
182 if (WITH_WAYLAND_FBDEV_LIB)
183 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicWaylandFbdevGLESv2)
184 endif(WITH_WAYLAND_FBDEV_LIB)
187 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLESv2)
188 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/X11GLESRenderer)
192 add_subdirectory_once (LayerManagerPlugins/Renderers/GraphicLib/LayerManagerGraphicGLESv2)
193 endif(WITH_GLESv2_LIB)
195 if (WITH_TEXT_RENDERER)
196 add_subdirectory_once (LayerManagerPlugins/Renderers/Platform/TextRenderer)
197 endif(WITH_TEXT_RENDERER)
199 if (WITH_SERVICE_BIN)
200 add_subdirectory_once (LayerManagerUtils)
201 add_subdirectory_once (LayerManagerBase)
202 add_subdirectory_once (LayerManagerService)
203 endif (WITH_SERVICE_BIN)
206 add_subdirectory_once (LayerManagerPlugins/IpcModules)
207 add_subdirectory_once (LayerManagerClient/ilmClient)
208 endif (WITH_CLIENT_LIB)
210 #==============================================================================
211 # store used build configuration
212 #==============================================================================
213 add_subdirectory_once(config)