LayerManagement: removed support for layergroup and surfacegroup
[profile/ivi/layer-management.git] / LayerManagerBase / CMakeLists.txt
1 ############################################################################
2
3 # Copyright 2010-2012 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
22 project(LayerManagerBase)
23 project_type(CORE)
24
25 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xlinker -export-dynamic")
26
27 if (WITH_DLT)
28     find_package(AutomotiveDlt REQUIRED)
29     include_directories(${DLT_INCLUDE_DIR})
30 endif (WITH_DLT)
31
32 include_directories(
33     include
34     ${CMAKE_SOURCE_DIR}/config
35     ${CMAKE_SOURCE_DIR}/LayerManagerUtils/include
36     ${CMAKE_SOURCE_DIR}/LayerManagerCommands/include
37 )
38
39 set(SRC_FILES
40     src/Configuration.cpp
41     src/GraphicalObject.cpp
42     src/GraphicalSurface.cpp
43     src/InputManager.cpp
44     src/Layermanager.cpp
45     src/PluginBase.cpp
46     src/PluginManager.cpp
47     src/Scene.cpp
48     src/SignalHandler.cpp
49     src/Shader.cpp
50     src/ShaderProgram.cpp
51     src/ShaderProgramFactory.cpp
52     src/ShaderUniform.cpp
53 )
54
55 add_library(${PROJECT_NAME} STATIC ${SRC_FILES})
56
57 add_dependencies(${PROJECT_NAME}
58     LayerManagerUtils
59 )
60
61 find_package (Threads)
62 set(LIBS ${LIBS}
63     LayerManagerUtils
64     dl
65     ${CMAKE_THREAD_LIBS_INIT}
66     ${DLT_LIBRARY}
67     ${STATICALLY_LINKED_PLUGINS}
68
69
70 target_link_libraries(${PROJECT_NAME} ${LIBS})
71
72 file(GLOB LM_INCLUDES include/*.h)
73
74 install (FILES ${LM_INCLUDES} DESTINATION include/layermanager)
75
76
77 if (WITH_TESTS)
78
79     find_package (Threads)
80
81     enable_testing()
82
83     set (CMAKE_CXX_FLAGS "")
84
85     add_executable(${PROJECT_NAME}_Test
86         tests/SceneTest.cpp
87         tests/LayermanagerTest.cpp
88         tests/InputManagerTest.cpp
89         tests/GraphicalObjectTest.cpp
90         tests/GraphicalSurfaceTest.cpp
91         tests/SurfaceTest.cpp
92         tests/LayerTest.cpp
93         tests/ShaderTest.cpp
94         tests/ShaderUniformTest.cpp
95         tests/ShaderProgramTest.cpp
96         tests/ShaderProgramFactoryTest.cpp
97         tests/RectangleTest.cpp
98     )
99
100     target_link_libraries(${PROJECT_NAME}_Test
101         ${LIBS}
102         LayerManagerBase
103         gtest
104         gmock
105         ${CMAKE_THREAD_LIBS_INIT}
106     )
107
108     add_test(${PROJECT_NAME} ${PROJECT_NAME}_Test)
109
110 endif(WITH_TESTS) 
111
112
113 #=============================================================
114 # configuration depending on system
115 #=============================================================
116 include(CheckFunctionExists)
117 check_function_exists(backtrace_symbols HAVE_BACKTRACE)
118 export_build_flag(HAVE_BACKTRACE "platform support for backtrace command")
119
120 include(CheckIncludeFiles)
121 check_include_files(execinfo.h HAVE_EXECINFO_H)
122 export_build_flag(HAVE_EXECINFO_H "platform has execinfo.h header file")
123