refactored printStackTrace(), now logging set to INFO
[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 4 )
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 default build type, if not defined by user
45 if (NOT CMAKE_BUILD_TYPE)
46     set(CMAKE_BUILD_TYPE Release CACHE STRING
47                          "Choose build type: Debug, Release, RelWithDebInfo, MinSizeRel."
48                          FORCE)
49     message(STATUS "Build type not defined. Using default build type 'Release'.")
50 endif (NOT CMAKE_BUILD_TYPE)
51
52
53 ##################### RPM CONFIG ########################
54 set(GENIVI_RPM_RELEASE "1${ILM_VERSION}")
55 set(SPEC_DIR ".")
56 #########################################################
57
58 # Platforms / A set of indiviual options at once
59
60 option (WITH_X11_GLES       "Build for X11 with GLES 2.0"                         ON )
61 option (WITH_GLESv2_LIB     "Build development library for GLES2 Based Renderers" OFF)
62 option (WITH_EGL_EXAMPLE    "Build EGL_EXAMPLE "                                  ON )
63 option (WITH_DESKTOP        "Build for Desktop / GLX"                             OFF)
64 option (WITH_GLX_LIB        "Build development library for GLX Based Renderers"   OFF)
65 option (WITH_GLX_EXAMPLE    "Build GLX_EXAMPLE "                                  OFF)
66 option (WITH_INPUT_EVENTS   "Activate input events handling"                      OFF)
67 option (WITH_FORCE_COPY     "Force Software Copy of Pixmaps"                      OFF)
68 option (WITH_XTHREADS       "Build with usage of X11 Threading"                   ON )
69 option (WITH_CLIENTEXAMPLES "Build client examples "                              ON )
70 option (WITH_TESTS          "Build Available Tests "                              OFF)
71
72 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
73
74 if (WITH_DESKTOP)
75     set (WITH_GLX_LIB ON CACHE STRING "" FORCE)
76 endif(WITH_DESKTOP)     
77
78 if (WITH_X11_GLES)
79     set (WITH_GLESv2_LIB ON CACHE STRING "" FORCE)
80 endif(WITH_X11_GLES)
81
82 include_directories ("${PROJECT_SOURCE_DIR}/3rdParty/")
83
84 add_subdirectory (3rdParty)
85 add_subdirectory (LayerManagerPlugins/Communicators/DBUSCommunicator)
86 add_subdirectory (LayerManagerClient/ilmClient)
87 add_subdirectory (LayerManagerUtils)
88 add_subdirectory (LayerManagerCommands)
89 add_subdirectory (LayerManagerService)
90
91 if (WITH_GLESv2_LIB OR WITH_GLX_LIB)
92     add_subdirectory (LayerManagerPlugins/Renderers/Graphic)
93 endif(WITH_GLESv2_LIB OR WITH_GLX_LIB)
94
95 if (WITH_DESKTOP)
96     add_subdirectory (LayerManagerPlugins/Renderers/Platform/GLXRenderer)
97 endif(WITH_DESKTOP)     
98
99 if (WITH_X11_GLES)
100     add_subdirectory (LayerManagerPlugins/Renderers/Platform/X11GLESRenderer)
101 endif(WITH_X11_GLES)   
102
103 if (WITH_EGL_EXAMPLE)
104     add_subdirectory (LayerManagerExamples/EGLX11ApplicationExample)
105     add_subdirectory (LayerManagerExamples/EGLX11MockNavigation)
106 endif(WITH_EGL_EXAMPLE)
107
108 if (WITH_GLX_EXAMPLE)
109     add_subdirectory (LayerManagerExamples/GLXApplicationExample)
110 endif(WITH_GLX_EXAMPLE)
111
112 if (WITH_CLIENTEXAMPLES)
113     add_subdirectory (LayerManagerExamples/LayerManagerClientExample)
114     add_subdirectory (LayerManagerExamples/LayerManagerToolBox)
115     add_subdirectory (LayerManagerExamples/LayerSceneDescriptionExample)
116 endif(WITH_CLIENTEXAMPLES)
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