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