ilmClient types are used internally to LM, so let's include them by default
[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 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_FBDEV  "Build Wayland with FBDEV backend"                    OFF)
52 option (WITH_WAYLAND_X11    "Build Wayland with X11 backend"                      OFF)
53 option (WITH_WAYLAND_DRM    "Build Wayland with drm backend"                      OFF)
54
55 # check and resolve option dependencies
56 # make sure, only one walynad based renderer was selected
57
58 if (WITH_DESKTOP)
59     set (WITH_GLX_LIB ON CACHE BOOL "Build development library for GLX Based Renderers" FORCE)
60 endif(WITH_DESKTOP)
61
62 if (WITH_X11_GLES)
63     set (WITH_GLESv2_LIB ON CACHE BOOL "Build development library for GLES2 Based Renderers" FORCE)
64 endif(WITH_X11_GLES)
65
66 set(NumberOfWaylandRenderers 0)
67
68 if (WITH_WAYLAND_X11)
69     set (WITH_GLESv2_LIB ON CACHE BOOL "Build development library for GLES2 Based Renderers" FORCE)
70     set (WITH_WAYLAND ON)
71     MATH(EXPR NumberOfWaylandRenderers "${NumberOfWaylandRenderers} + 1")
72 endif(WITH_WAYLAND_X11)
73
74 if (WITH_WAYLAND_FBDEV)
75     set (WITH_GLESv2_LIB ON CACHE BOOL "Build development library for GLES2 Based Renderers" FORCE)
76     set (WITH_WAYLAND ON)
77     MATH(EXPR NumberOfWaylandRenderers "${NumberOfWaylandRenderers} + 1")
78 endif(WITH_WAYLAND_FBDEV)
79
80 if (WITH_WAYLAND_DRM)
81     set (WITH_GLESv2_LIB ON CACHE BOOL "Build development library for GLES2 Based Renderers" FORCE)
82     set (WITH_WAYLAND ON)
83     MATH(EXPR NumberOfWaylandRenderers "${NumberOfWaylandRenderers} + 1")
84 endif(WITH_WAYLAND_DRM)
85
86 if(NumberOfWaylandRenderers GREATER 1) 
87     MESSAGE(FATAL_ERROR "More than one Wayland based renderer was selected. This is not supported.")
88 endif(NumberOfWaylandRenderers GREATER 1)
89
90
91
92 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
93
94 add_subdirectory(cmake/optionalFeatures)
95
96 add_subdirectory(config)
97
98 include_directories ("${PROJECT_SOURCE_DIR}/3rdParty/")
99 # ilm_types are used internally to LM, so we can include them by default
100 include_directories ("${PROJECT_SOURCE_DIR}/LayerManagerClient/ilmClient/include")
101
102 add_subdirectory (3rdParty)
103 add_subdirectory (LayerManagerPlugins/Communicators/GenericCommunicator)
104 add_subdirectory (LayerManagerPlugins/IpcModules)
105 add_subdirectory (LayerManagerClient/ilmClient)
106 add_subdirectory (LayerManagerCommands)
107 add_subdirectory (LayerManagerService)
108 add_subdirectory (LayerManagerUtils)
109 add_subdirectory (LayerManagerPlugins/Renderers/Graphic)
110
111 if (WITH_DESKTOP)
112     add_subdirectory (LayerManagerPlugins/Renderers/Platform/GLXRenderer)
113 endif(WITH_DESKTOP)     
114
115 if (WITH_WAYLAND)
116     if (WITH_WAYLAND_VIVANTE_GAL)
117         add_subdirectory (LayerManagerPlugins/Renderers/Platform/WaylandVivanteRenderer)
118     else (WITH_WAYLAND_VIVANTE_GAL)
119         add_subdirectory (LayerManagerPlugins/Renderers/Platform/WaylandGLESRenderer)
120     endif (WITH_WAYLAND_VIVANTE_GAL)
121 endif(WITH_WAYLAND)
122
123 if (WITH_X11_GLES)
124     add_subdirectory (LayerManagerPlugins/Renderers/Platform/X11GLESRenderer)
125 endif(WITH_X11_GLES)
126
127 if (WITH_EGL_EXAMPLE)
128     add_subdirectory (LayerManagerExamples/EGLX11ApplicationExample)
129     add_subdirectory (LayerManagerExamples/EGLX11MockNavigation)
130 endif(WITH_EGL_EXAMPLE)
131
132 if (WITH_GLX_EXAMPLE)
133     add_subdirectory (LayerManagerExamples/GLXApplicationExample)
134 endif(WITH_GLX_EXAMPLE)
135
136 if (WITH_CLIENTEXAMPLES)
137     add_subdirectory (LayerManagerExamples/LayerManagerClientExample)
138     add_subdirectory (LayerManagerExamples/LayerManagerToolBox)
139     add_subdirectory (LayerManagerExamples/LayerManagerControl)
140     add_subdirectory (LayerManagerExamples/LayerSceneDescriptionExample)
141 endif(WITH_CLIENTEXAMPLES)
142
143 if (WITH_WL_EXAMPLE)
144     add_subdirectory (LayerManagerExamples/EGLWLApplicationExample)
145     add_subdirectory (LayerManagerExamples/EGLWLMockNavigation)
146 endif(WITH_WL_EXAMPLE)
147
148 # enable ctest if building with tests
149 # run 'make test' after build to run all tests
150 # be aware that some tests require a running layermanager
151 if (WITH_TESTS)
152     enable_testing()
153 endif(WITH_TESTS)
154
155