added first working version of MockNavigation
[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 SET( ${PROJECT_NAME}_MAJOR_VERSION 0 )
26 SET( ${PROJECT_NAME}_MINOR_VERSION 9 )
27 SET( ${PROJECT_NAME}_PATCH_LEVEL 3 )
28
29 SET(VERSION ${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_PATCH_LEVEL})
30 if(NOT DEFINED ILM_VERSION)
31 execute_process(COMMAND git describe --tags WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 
32                 OUTPUT_VARIABLE ILM_VERSION 
33                 OUTPUT_STRIP_TRAILING_WHITESPACE)
34 endif(NOT DEFINED ILM_VERSION)
35                 
36 set(LICENSE "APACHE 2.0")
37
38 set(GENIVI_PROJECT_VERSION ${VERSION})
39 message(STATUS
40         "Build for Version ${VERSION} build ${ILM_VERSION}"
41         )
42
43 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DILM_VERSION='\"${ILM_VERSION}\"' " CACHE STRING "" FORCE)        
44
45 ##################### RPM CONFIG ########################
46 set(GENIVI_RPM_RELEASE "1${ILM_VERSION}")
47 set(SPEC_DIR ".")
48 #########################################################
49
50
51 # Platforms / A set of indiviual options at once
52 # Choose only ONE of these!!
53
54 option (WITH_X11_GLES 
55         "Build for X11 with GLES 2.0" ON)   
56                
57 option (WITH_DESKTOP 
58         "Build for Desktop / GLX" OFF)
59
60 option (WITH_CLIENTEXAMPLES 
61         "Build client examples " ON)
62
63
64 option (WITH_EGL_EXAMPLE 
65         "Build EGL_EXAMPLE " ON)
66
67 option (WITH_GLX_EXAMPLE 
68         "Build GLX_EXAMPLE " OFF)
69         
70 option (WITH_TESTS
71         "Build Available Tests " OFF)
72         
73 option (WITH_XTHREADS
74         "Build with usage of X11 Threading" ON)
75         
76 option (WITH_GLX_LIB
77         "Build development library for GLX Based Renderers" OFF)
78         
79 option (WITH_GLESv2_LIB
80         "Build development library for GLES2 Based Renderers" OFF)
81
82 option (WITH_INPUT_EVENTS
83         "Activate input events handling" OFF)
84
85 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
86
87 option (WITH_FORCE_COPY 
88         "Force Software Copy of Pixmaps" OFF)
89
90 if (WITH_XTHREADS)
91 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_XTHREADS" CACHE STRING "" FORCE)
92 endif(WITH_XTHREADS)
93
94 if (WITH_INPUT_EVENTS)
95 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_INPUT_EVENTS" CACHE STRING "" FORCE)
96 endif(WITH_INPUT_EVENTS)
97
98         
99 if (WITH_FORCE_COPY)
100 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGLX_GRAPHICSYSTEM_FORCE_COPY -DGLES_FORCE_COPY" CACHE STRING "" FORCE)
101 endif(WITH_FORCE_COPY)
102
103 include_directories ("${PROJECT_SOURCE_DIR}/3rdParty/")
104 add_subdirectory (3rdParty)
105
106 add_subdirectory (LayerManagerPlugins/Communicators/DBUSCommunicator)
107 add_subdirectory (LayerManagerClient/ilmClient)
108 add_subdirectory (LayerManagerUtils)
109 add_subdirectory (LayerManagerCommands)
110 add_subdirectory (LayerManagerService)
111
112 if (WITH_DESKTOP)
113 set (WITH_GLX_LIB ON CACHE STRING "" FORCE)
114 endif(WITH_DESKTOP)     
115
116 if (WITH_X11_GLES)
117 set (WITH_GLESv2_LIB ON CACHE STRING "" FORCE)
118 endif(WITH_X11_GLES)   
119 if (WITH_GLESv2_LIB OR WITH_GLX_LIB )    
120     add_subdirectory (LayerManagerPlugins/Renderers/Graphic)
121 endif(WITH_GLESv2_LIB OR WITH_GLX_LIB)
122
123 if (WITH_DESKTOP)
124     add_subdirectory (LayerManagerPlugins/Renderers/Platform/GLXRenderer)
125 endif(WITH_DESKTOP)     
126
127 if (WITH_X11_GLES)
128     add_subdirectory (LayerManagerPlugins/Renderers/Platform/X11GLESRenderer)
129 endif(WITH_X11_GLES)   
130
131 if (WITH_EGL_EXAMPLE)
132     add_subdirectory (LayerManagerExamples/EGLX11ApplicationExample)
133     add_subdirectory (LayerManagerExamples/EGLX11MockNavigation)
134 endif(WITH_EGL_EXAMPLE)
135
136 if (WITH_GLX_EXAMPLE)
137     add_subdirectory (LayerManagerExamples/GLXApplicationExample)
138 endif(WITH_GLX_EXAMPLE)
139
140 if (WITH_CLIENTEXAMPLES)
141 add_subdirectory (LayerManagerExamples/LayerManagerClientExample)
142 add_subdirectory (LayerManagerExamples/LayerManagerToolBox)
143 add_subdirectory (LayerManagerExamples/LayerSceneDescriptionExample)
144 endif(WITH_CLIENTEXAMPLES)
145
146 # enable ctest if building with tests
147 # run 'make test' after build to run all tests
148 # be aware that some tests require a running layermanager
149 if (WITH_TESTS)
150 enable_testing()
151 endif(WITH_TESTS)
152
153