LayerManagerService: fixed broken build of unit tests
[profile/ivi/layer-management.git] / LayerManagerService / 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 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xlinker -export-dynamic")
23 if (WITH_DLT)
24 find_package(AutomotiveDlt REQUIRED)
25 include_directories(${DLT_INCLUDE_DIR})
26 endif (WITH_DLT)
27
28 include_directories ("include")
29 include_directories ("${CMAKE_SOURCE_DIR}/config")
30 include_directories ("${CMAKE_SOURCE_DIR}/LayerManagerUtils/include")
31 include_directories ("${CMAKE_SOURCE_DIR}/LayerManagerCommands/include")
32
33 file(GLOB LM_SOURCES src/*.cpp src/shader/*.cpp)
34 file(GLOB LM_INCLUDES include/*.h)
35
36 add_executable(LayerManagerService ${LM_SOURCES} ${LM_INCLUDES} ${CMAKE_SOURCE_DIR}/config/config.h)
37
38 add_dependencies(LayerManagerService LayerManagerUtils)
39 add_dependencies(LayerManagerService LayerManagerCommands)
40
41
42 find_package (Threads)
43 set(LIBS ${LIBS}
44          LayerManagerUtils 
45          LayerManagerCommands
46          dl
47          ${CMAKE_THREAD_LIBS_INIT}
48          ${DLT_LIBRARY}) 
49
50 target_link_libraries(LayerManagerService ${LIBS})
51
52 install (TARGETS LayerManagerService DESTINATION bin)
53 install (FILES ${LM_INCLUDES} DESTINATION include/layermanager)
54
55
56 if (WITH_TESTS)
57 enable_testing()
58 set (CMAKE_CXX_FLAGS "")
59 add_executable(LayerManagerService_Test
60     tests/SceneTest.cpp
61     tests/ScreenTest.cpp
62     tests/LayermanagerTest.cpp
63     tests/InputManagerTest.cpp
64     tests/GraphicalObjectTest.cpp
65     tests/GraphicalGroupTest.cpp
66     tests/GraphicalSurfaceTest.cpp
67     tests/SurfaceTest.cpp
68     tests/LayerTest.cpp
69     tests/ShaderTest.cpp
70     tests/ShaderUniformTest.cpp
71     tests/ShaderProgramTest.cpp
72     tests/ShaderProgramFactoryTest.cpp
73     tests/RectangleTest.cpp
74     
75     src/GraphicalObject.cpp
76     src/GraphicalSurface.cpp
77     src/Layermanager.cpp
78     src/InputManager.cpp
79     src/PluginManager.cpp
80     src/PluginBase.cpp
81     src/PluginManager.cpp
82     src/Scene.cpp
83     src/shader/Shader.cpp
84     src/shader/ShaderProgram.cpp
85     src/shader/ShaderProgramFactory.cpp
86     src/shader/ShaderUniform.cpp
87     src/Configuration.cpp
88 )
89 target_link_libraries(LayerManagerService_Test ${LIBS} gtest gmock)
90
91 add_test(LayerManagerService LayerManagerService_Test )
92
93 endif(WITH_TESTS) 
94
95
96 #=============================================================
97 # configuration depending on system
98 #=============================================================
99 include(CheckFunctionExists)
100 check_function_exists(backtrace_symbols HAVE_BACKTRACE)
101
102 include(CheckIncludeFiles)
103 check_include_files(execinfo.h HAVE_EXECINFO_H)