-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
67 lines (54 loc) · 1.82 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
cmake_minimum_required(VERSION 3.4.0)
project(FlexKalman VERSION 0.6.0)
set(LOCAL_CMAKE_MODULE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake-local")
# Custom CMake modules from https://github.com/rpavlik/cmake-modules
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake"
"${LOCAL_CMAKE_MODULE_DIR}")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
include(CTest)
include(GNUInstallDirs)
include(CMakeDependentOption)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
###
# Package Options
###
# Only required on Windows - elsewhere, just used for extra tools.
find_package(Boost)
###
# Building
###
# vendored dependencies
add_subdirectory(vendor)
# Core library
add_subdirectory(inc)
if(BUILD_TESTING)
add_subdirectory(tests)
endif()
###
# Set Up Package for External Usage
###
include(CMakePackageConfigHelpers)
include(GenerateCompatibilityVersionFile)
set(CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/FlexKalman/cmake")
configure_file(cmake-local/FindEigen3.cmake
${CMAKE_CURRENT_BINARY_DIR}/FindEigen3.cmake COPYONLY)
generate_compatibility_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/FlexKalmanConfigVersion.cmake" VERSION
${PROJECT_VERSION} COMPATIBILITY AnyNewerVersion C_ABI)
export(
TARGETS eigen-headers FlexKalman
FILE "${CMAKE_CURRENT_BINARY_DIR}/FlexKalmanTargets.cmake"
NAMESPACE FlexKalman::)
export(PACKAGE FlexKalman)
configure_file(FlexKalmanConfig.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/FlexKalmanConfig.cmake" COPYONLY)
install(
EXPORT FlexKalmanTargets
FILE FlexKalmanTargets.cmake
NAMESPACE FlexKalman::
DESTINATION ${CONFIG_INSTALL_DIR})
install(
FILES FlexKalmanConfig.cmake cmake/FindEigen3.cmake
"${CMAKE_CURRENT_BINARY_DIR}/FlexKalmanConfigVersion.cmake"
DESTINATION ${CONFIG_INSTALL_DIR}
COMPONENT Devel)