1 ############################################################################
3 # Copyright 2010, 2011 BMW Car IT GmbH
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 ############################################################################
20 cmake_minimum_required (VERSION 2.6)
21 project (LayerManager)
23 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")
25 include(${CMAKE_MODULE_PATH}/CMakeVersions.txt)
27 # set default build type, if not defined by user
28 if (NOT CMAKE_BUILD_TYPE)
29 set(CMAKE_BUILD_TYPE Release CACHE STRING
30 "Choose build type: Debug, Release, RelWithDebInfo, MinSizeRel."
32 message(STATUS "Build type not defined. Using default build type 'Release'.")
33 endif (NOT CMAKE_BUILD_TYPE)
35 # Platforms / A set of indiviual options at once
37 option (WITH_X11_GLES "Build for X11 with GLES 2.0" ON )
38 option (WITH_GLESv2_LIB "Build development library for GLES2 Based Renderers" OFF)
39 option (WITH_EGL_EXAMPLE "Build EGL_EXAMPLE " ON )
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_INPUT_EVENTS "Activate input events handling" OFF)
44 option (WITH_FORCE_COPY "Force Software Copy of Pixmaps" OFF)
45 option (WITH_XTHREADS "Build with usage of X11 Threading" ON )
46 option (WITH_CLIENTEXAMPLES "Build client examples " ON )
47 option (WITH_TESTS "Build Available Tests " OFF)
48 option (WITH_DLT "Build with DLT support " OFF)
50 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
52 # generate cmake configuration header file, includes information on the
53 # project configuration, compiler settings, ...
54 message(STATUS "Generating config.h header file with build system configuration.")
56 ${CMAKE_CURRENT_SOURCE_DIR}/config/config.h.cmake
57 ${CMAKE_CURRENT_SOURCE_DIR}/config/config.h
61 set (WITH_GLX_LIB ON CACHE STRING "" FORCE)
65 set (WITH_GLESv2_LIB ON CACHE STRING "" FORCE)
68 include_directories ("${PROJECT_SOURCE_DIR}/3rdParty/")
70 add_subdirectory (3rdParty)
71 add_subdirectory (LayerManagerPlugins/Communicators/DBUSCommunicator)
72 add_subdirectory (LayerManagerClient/ilmClient)
73 add_subdirectory (LayerManagerCommands)
74 add_subdirectory (LayerManagerService)
75 add_subdirectory (LayerManagerUtils)
77 if (WITH_GLESv2_LIB OR WITH_GLX_LIB)
78 add_subdirectory (LayerManagerPlugins/Renderers/Graphic)
79 endif(WITH_GLESv2_LIB OR WITH_GLX_LIB)
82 add_subdirectory (LayerManagerPlugins/Renderers/Platform/GLXRenderer)
86 add_subdirectory (LayerManagerPlugins/Renderers/Platform/X11GLESRenderer)
90 add_subdirectory (LayerManagerExamples/EGLX11ApplicationExample)
91 add_subdirectory (LayerManagerExamples/EGLX11MockNavigation)
92 endif(WITH_EGL_EXAMPLE)
95 add_subdirectory (LayerManagerExamples/GLXApplicationExample)
96 endif(WITH_GLX_EXAMPLE)
98 if (WITH_CLIENTEXAMPLES)
99 add_subdirectory (LayerManagerExamples/LayerManagerClientExample)
100 add_subdirectory (LayerManagerExamples/LayerManagerToolBox)
101 add_subdirectory (LayerManagerExamples/LayerSceneDescriptionExample)
102 endif(WITH_CLIENTEXAMPLES)
104 # enable ctest if building with tests
105 # run 'make test' after build to run all tests
106 # be aware that some tests require a running layermanager