LayerManagerBase: moved library to separate directory
[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
24 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xlinker -export-dynamic")
25
26 if (WITH_DLT)
27     find_package(AutomotiveDlt REQUIRED)
28     include_directories(${DLT_INCLUDE_DIR})
29 endif (WITH_DLT)
30
31 include_directories(
32     include
33     ${CMAKE_SOURCE_DIR}/config
34     ${CMAKE_SOURCE_DIR}/LayerManagerUtils/include
35     ${CMAKE_SOURCE_DIR}/LayerManagerCommands/include
36 )
37
38 set(SRC_FILES
39     src/Configuration.cpp
40     src/GraphicalObject.cpp
41     src/GraphicalSurface.cpp
42     src/InputManager.cpp
43     src/Layermanager.cpp
44     src/PluginBase.cpp
45     src/PluginManager.cpp
46     src/Scene.cpp
47     src/SignalHandler.cpp
48     src/Shader.cpp
49     src/ShaderProgram.cpp
50     src/ShaderProgramFactory.cpp
51     src/ShaderUniform.cpp
52 )
53
54 add_library(${PROJECT_NAME} STATIC ${SRC_FILES})
55
56 add_dependencies(${PROJECT_NAME}
57     LayerManagerUtils
58 )
59
60 find_package (Threads)
61 set(LIBS ${LIBS}
62     LayerManagerUtils
63     dl
64     ${CMAKE_THREAD_LIBS_INIT}
65     ${DLT_LIBRARY}
66     ${STATICALLY_LINKED_PLUGINS}
67
68
69 target_link_libraries(${PROJECT_NAME} ${LIBS})
70
71 file(GLOB LM_INCLUDES include/*.h)
72
73 install (FILES ${LM_INCLUDES} DESTINATION include/layermanager)
74
75
76 if (WITH_TESTS)
77
78     find_package (Threads)
79
80     enable_testing()
81
82     set (CMAKE_CXX_FLAGS "")
83
84     add_executable(${PROJECT_NAME}_Test
85         tests/SceneTest.cpp
86         tests/LayermanagerTest.cpp
87         tests/InputManagerTest.cpp
88         tests/GraphicalObjectTest.cpp
89         tests/GraphicalGroupTest.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
119 include(CheckIncludeFiles)
120 check_include_files(execinfo.h HAVE_EXECINFO_H)