4c9e0bb40108c043ad71b1a1f8278b0d2e87be83
[profile/ivi/layer-management.git] / CMakeLists.txt
1 ############################################################################
2
3 # Copyright 2010, 2011 BMW Car IT GmbH  
4
5
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 
9 #
10 #       http://www.apache.org/licenses/LICENSE-2.0 
11 #
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.
17 #
18 ############################################################################
19
20 cmake_minimum_required (VERSION 2.6)
21 project (LayerManager)
22
23 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")
24
25 include(${CMAKE_MODULE_PATH}/CMakeVersions.txt)
26
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."
31                          FORCE)
32     message(STATUS "Build type not defined. Using default build type 'Release'.")
33 endif (NOT CMAKE_BUILD_TYPE)
34
35 # Platforms / A set of indiviual options at once
36
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)
49
50 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
51
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.")
55 configure_file(
56     ${CMAKE_CURRENT_SOURCE_DIR}/config/config.h.cmake
57     ${CMAKE_CURRENT_SOURCE_DIR}/config/config.h
58 )
59
60 if (WITH_DESKTOP)
61     set (WITH_GLX_LIB ON CACHE STRING "" FORCE)
62 endif(WITH_DESKTOP)     
63
64 if (WITH_X11_GLES)
65     set (WITH_GLESv2_LIB ON CACHE STRING "" FORCE)
66 endif(WITH_X11_GLES)
67
68 include_directories ("${PROJECT_SOURCE_DIR}/3rdParty/")
69
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)
76
77 if (WITH_GLESv2_LIB OR WITH_GLX_LIB)
78     add_subdirectory (LayerManagerPlugins/Renderers/Graphic)
79 endif(WITH_GLESv2_LIB OR WITH_GLX_LIB)
80
81 if (WITH_DESKTOP)
82     add_subdirectory (LayerManagerPlugins/Renderers/Platform/GLXRenderer)
83 endif(WITH_DESKTOP)     
84
85 if (WITH_X11_GLES)
86     add_subdirectory (LayerManagerPlugins/Renderers/Platform/X11GLESRenderer)
87 endif(WITH_X11_GLES)   
88
89 if (WITH_EGL_EXAMPLE)
90     add_subdirectory (LayerManagerExamples/EGLX11ApplicationExample)
91     add_subdirectory (LayerManagerExamples/EGLX11MockNavigation)
92 endif(WITH_EGL_EXAMPLE)
93
94 if (WITH_GLX_EXAMPLE)
95     add_subdirectory (LayerManagerExamples/GLXApplicationExample)
96 endif(WITH_GLX_EXAMPLE)
97
98 if (WITH_CLIENTEXAMPLES)
99     add_subdirectory (LayerManagerExamples/LayerManagerClientExample)
100     add_subdirectory (LayerManagerExamples/LayerManagerToolBox)
101     add_subdirectory (LayerManagerExamples/LayerSceneDescriptionExample)
102 endif(WITH_CLIENTEXAMPLES)
103
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
107 if (WITH_TESTS)
108     enable_testing()
109 endif(WITH_TESTS)
110
111