CMakeLists.txt 2.63 KB
Newer Older
1
2
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7)

3
PROJECT(doocs-TC4-EqFct)
4

5
SET(${PROJECT_NAME}_MAJOR_VERSION 01)
6
SET(${PROJECT_NAME}_MINOR_VERSION 06)
Martin Killenberg's avatar
Martin Killenberg committed
7
SET(${PROJECT_NAME}_PATCH_VERSION 03)
8
9
10
11
include(${CMAKE_SOURCE_DIR}/cmake/set_version_numbers.cmake)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)

12
13
14
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/set_default_build_to_release.cmake)
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/set_default_flags.cmake)

15
16
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

17
#enable code coverage report.
18
include(cmake/enable_code_coverage_report.cmake)
19
20
21
22

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${${PROJECT_NAME}_CXX_FLAGS}")

include(${CMAKE_SOURCE_DIR}/cmake/add_dependency.cmake)
23
24
add_dependency(DOOCS 18.10.11 server REQUIRED)
add_dependency(DAction 2.5 REQUIRED)
25
add_dependency(ChimeraTK-DeviceAccess 01.08 REQUIRED)
26
add_dependency(Doocs-RF-Util 0.1 REQUIRED)
27
28
29
30
31
32
33

include_directories(${PROJECT_SOURCE_DIR}/include)
AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR}/src LIB_SOURCES)

ADD_LIBRARY(${PROJECT_NAME} SHARED ${LIB_SOURCES})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${${PROJECT_NAME}_FULL_LIBRARY_VERSION} SOVERSION ${${PROJECT_NAME}_SOVERSION})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${PROJECT_NAME})
34
target_link_libraries(${PROJECT_NAME} ${mtca4u-deviceaccess_LIBRARIES} ${DOOCS_LIBRARIES} ${DAction_LIBRARIES} ${Doocs-RF-Util_LIBRARIES})
35
36
37
38
39

#Create the config files by filling the correct variables into the template (*.cmake.in).
#All variables @VARIABLE@ are replaced with the current values, but they have to be set first....
#Only the reference header is needed. The other variables are for dependencies of this library,
#but there are none.
40
41
42
43
#
#We 'only' give the DAction flags. They already include the DOOCS and DeviceAccess stuff.
set(${PROJECT_NAME}_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/include ${DAction_INCLUDE_DIRS}")
set(${PROJECT_NAME}_LIBRARIES "${DAction_LIBRARIES}")
44
45
#note: the ${FuseRelayBoard_LIBRARY_DIRS} is not needed as the library itself is absolute. It would even disturb because
#it might sneak in a system directory.
46
47
set(${PROJECT_NAME}_LIBRARY_DIRS "${CMAKE_INSTALL_PREFIX}/lib ${DAction_LIBRARY_DIRS}")
set(${PROJECT_NAME}_CXX_FLAGS "${${PROJECT_NAME}_CXX_FLAGS} ${DAction_CXX_FLAGS}")
48
49
50
51
52
53
54
set(${PROJECT_NAME}_LINKER_FLAGS "-Wl,-rpath=${CMAKE_INSTALL_PREFIX}/lib,--enable-new-dtags")
include(${CMAKE_SOURCE_DIR}/cmake/create_cmake_config_files.cmake)

INSTALL(DIRECTORY include/ DESTINATION include/${PROJECT_NAME})
INSTALL(TARGETS ${PROJECT_NAME}
        RUNTIME DESTINATION bin
        LIBRARY DESTINATION lib
55
        ARCHIVE DESTINATION lib)
56
57
58
59

#the section for the automatic tests:
ENABLE_TESTING()
add_subdirectory(tests)