-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
73 lines (61 loc) · 1.44 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
68
69
70
71
72
73
cmake_minimum_required(VERSION 3.21)
project(
LibSinex
VERSION 1.1.0
DESCRIPTION ""
LANGUAGES CXX
)
find_package(Eigen3 3.3 REQUIRED)
find_package(datetime 1 REQUIRED)
find_package(geodesy 1 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(sinex)
target_include_directories(sinex PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/>
$<INSTALL_INTERFACE:include/sinex>
)
add_subdirectory(src)
# The tests
include(CTest)
add_subdirectory(test)
enable_testing()
install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/
DESTINATION include/sinex
)
install(TARGETS sinex
EXPORT sinexTargets
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
install(EXPORT sinexTargets
FILE sinexTargets.cmake
NAMESPACE dso::
DESTINATION lib/cmake
)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"sinexConfigVersion.cmake"
VERSION ${sinex_version}
COMPATIBILITY AnyNewerVersion
)
install(FILES "sinexConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/sinexConfigVersion.cmake"
DESTINATION lib/cmake
)