ac87d333f29e6ab567c80d95186f96ad7af8d759
[profile/ivi/layer-management.git] / CMakeLists.txt
1 ############################################################################
2
3 # Copyright 2010, 2011 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 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")
25
26 include(${CMAKE_MODULE_PATH}/CMakeVersions.txt)
27
28 # set default build type, if not defined by user
29 if (NOT CMAKE_BUILD_TYPE)
30     set(CMAKE_BUILD_TYPE Release CACHE STRING
31                          "Choose build type: Debug, Release, RelWithDebInfo, MinSizeRel."
32                          FORCE)
33     message(STATUS "Build type not defined. Using default build type 'Release'.")
34 endif (NOT CMAKE_BUILD_TYPE)
35
36 # Platforms / A set of indiviual options at once
37
38 option (WITH_X11_GLES       "Build for X11 with GLES 2.0"                         ON )
39 option (WITH_GLESv2_LIB     "Build development library for GLES2 Based Renderers" OFF)
40 option (WITH_EGL_EXAMPLE    "Build EGL_EXAMPLE / X11"                             ON )
41 option (WITH_WL_EXAMPLE     "Build EGL_EXAMPLE / Wayland"                         OFF)
42 option (WITH_DESKTOP        "Build for Desktop / GLX"                             OFF)
43 option (WITH_GLX_LIB        "Build development library for GLX Based Renderers"   OFF)
44 option (WITH_GLX_EXAMPLE    "Build GLX_EXAMPLE "                                  OFF)
45 option (WITH_INPUT_EVENTS   "Activate input events handling"                      OFF)
46 option (WITH_FORCE_COPY     "Force Software Copy of Pixmaps"                      OFF)
47 option (WITH_XTHREADS       "Build with usage of X11 Threading"                   ON )
48 option (WITH_CLIENTEXAMPLES "Build client examples "                              ON )
49 option (WITH_TESTS          "Build Available Tests "                              OFF)
50 option (WITH_DLT            "Build with DLT support "                             OFF)
51 option (WITH_WAYLAND        "Build plugin of Wayland GBS"                         OFF)
52 option (WITH_WAYLAND_FBDEV  "Build Wayland with FBDEV backend"                    OFF)
53 option (WITH_WAYLAND_X11    "Build Wayland with X11 backend"                      OFF)
54
55 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
56
57 add_subdirectory(config)
58
59 if (WITH_DESKTOP)
60     set (WITH_GLX_LIB ON CACHE STRING "" FORCE)
61 endif(WITH_DESKTOP)     
62
63 if (WITH_X11_GLES OR WITH_WAYLAND)
64     set (WITH_GLESv2_LIB ON CACHE STRING "" FORCE)
65 endif(WITH_X11_GLES OR WITH_WAYLAND)
66
67 include_directories ("${PROJECT_SOURCE_DIR}/3rdParty/")
68
69 add_subdirectory (3rdParty)
70 add_subdirectory (LayerManagerPlugins/Communicators/DBUSCommunicator)
71 add_subdirectory (LayerManagerClient/ilmClient)
72 add_subdirectory (LayerManagerCommands)
73 add_subdirectory (LayerManagerService)
74 add_subdirectory (LayerManagerUtils)
75
76 if (WITH_GLESv2_LIB OR WITH_GLX_LIB)
77     add_subdirectory (LayerManagerPlugins/Renderers/Graphic)
78 endif(WITH_GLESv2_LIB OR WITH_GLX_LIB)
79
80 if (WITH_DESKTOP)
81     add_subdirectory (LayerManagerPlugins/Renderers/Platform/GLXRenderer)
82 endif(WITH_DESKTOP)     
83
84 if (WITH_WAYLAND)
85     if (NOT WITH_WAYLAND_FBDEV AND NOT WITH_WAYLAND_X11)
86         message(FATAL_ERROR "Consider to specify WITH_WAYLAND_FBDEV or WITH_WAYLAND_X11")
87     endif(NOT WITH_WAYLAND_FBDEV AND NOT WITH_WAYLAND_X11)
88     if (WITH_WAYLAND_FBDEV AND WITH_WAYLAND_X11)
89         message(FATAL_ERROR "WITH_WAYLAND_FBDEV and WITH_WAYLAND_X11 can't be specified at the same time")
90     endif(WITH_WAYLAND_FBDEV AND WITH_WAYLAND_X11)
91     add_subdirectory (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
92 endif(WITH_WAYLAND)     
93
94 if (WITH_X11_GLES)
95     add_subdirectory (LayerManagerPlugins/Renderers/Platform/X11GLESRenderer)
96 endif(WITH_X11_GLES)   
97
98 if (WITH_EGL_EXAMPLE)
99     add_subdirectory (LayerManagerExamples/EGLX11ApplicationExample)
100     add_subdirectory (LayerManagerExamples/EGLX11MockNavigation)
101 endif(WITH_EGL_EXAMPLE)
102
103 if (WITH_GLX_EXAMPLE)
104     add_subdirectory (LayerManagerExamples/GLXApplicationExample)
105 endif(WITH_GLX_EXAMPLE)
106
107 if (WITH_CLIENTEXAMPLES)
108     add_subdirectory (LayerManagerExamples/LayerManagerClientExample)
109     add_subdirectory (LayerManagerExamples/LayerManagerToolBox)
110     add_subdirectory (LayerManagerExamples/LayerSceneDescriptionExample)
111 endif(WITH_CLIENTEXAMPLES)
112
113 if (WITH_WL_EXAMPLE)
114     add_subdirectory (LayerManagerExamples/EGLWLApplicationExample)
115     add_subdirectory (LayerManagerExamples/EGLWLMockNavigation)
116 endif(WITH_WL_EXAMPLE)
117
118 # enable ctest if building with tests
119 # run 'make test' after build to run all tests
120 # be aware that some tests require a running layermanager
121 if (WITH_TESTS)
122     enable_testing()
123 endif(WITH_TESTS)
124
125