-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
73 lines (61 loc) · 1.5 KB
/
CMakeLists.txt
File metadata and controls
73 lines (61 loc) · 1.5 KB
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
68
69
70
71
72
73
cmake_minimum_required(VERSION 3.11)
project(
Geodesy
VERSION 1.1.0
DESCRIPTION "DSO Geodetic Library"
LANGUAGES CXX)
# We need Eigen
find_package(Eigen3 3.3 REQUIRED)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED On)
set(CMAKE_CXX_EXTENSIONS Off)
add_compile_options(-Wall
-Wextra
-Werror
-pedantic
-W
-Wshadow
$<$<CONFIG:Release>:-O2>
$<$<CONFIG:Release>:-march=native>
$<$<CONFIG:Debug>:-g>
$<$<CONFIG:Debug>:-pg>
$<$<CONFIG:Debug>:-Wdisabled-optimization>
)
add_compile_definitions(
$<$<CONFIG:Debug>:DEBUG>
)
add_library(geodesy)
target_include_directories(geodesy PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/>
$<INSTALL_INTERFACE:include/geodesy>
)
add_subdirectory(src)
# The tests
include(CTest)
add_subdirectory(test/unit_tests)
enable_testing()
# Install headers at: $PREFIX/datetime/...
install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/
DESTINATION include/geodesy
)
# install library
install(TARGETS geodesy
EXPORT geodesyTargets
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
install(EXPORT geodesyTargets
FILE geodesyTargets.cmake
NAMESPACE dso::
DESTINATION lib/cmake
)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"geodesyConfigVersion.cmake"
VERSION ${geodesy_version}
COMPATIBILITY AnyNewerVersion
)
install(FILES "geodesyConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/geodesyConfigVersion.cmake"
DESTINATION lib/cmake
)