1
- cmake_minimum_required (VERSION 3.1 )
1
+ cmake_minimum_required (VERSION 3.11 )
2
2
3
3
project (
4
4
Geodesy
@@ -9,20 +9,61 @@ project(
9
9
# We need Eigen
10
10
find_package (Eigen3 3.3 REQUIRED)
11
11
12
- # The library
13
- add_subdirectory (src)
14
-
15
- # The tests
16
12
include (CTest)
17
- add_subdirectory (test // unit_tests)
13
+ add_subdirectory (test /unit_tests)
18
14
enable_testing ()
19
15
20
- add_compile_options (
21
- -Wall -Wextra -Werror -pedantic -W -Wshadow -march=native -DEIGEN_NO_AUTOMATIC_RESIZING
22
- $<$<CONFIG:RELEASE>:-O2 -march=native -DEIGEN_NO_AUTOMATIC_RESIZING>
23
- $<$<CONFIG:DEBUG>:-g -pg -Wdisabled-optimization -DDEBUG>
24
- )
25
-
26
16
set (CMAKE_CXX_STANDARD 17)
27
17
set (CMAKE_CXX_STANDARD_REQUIRED On )
28
18
set (CMAKE_CXX_EXTENSIONS Off )
19
+ add_compile_options (-Wall
20
+ -Wextra
21
+ -Werror
22
+ -pedantic
23
+ -W
24
+ -Wshadow
25
+ $<$<CONFIG:Release>:-O2>
26
+ $<$<CONFIG:Release>:-march=native>
27
+ $<$<CONFIG:Debug>:-g>
28
+ $<$<CONFIG:Debug>:-pg>
29
+ $<$<CONFIG:Debug>:-Wdisabled-optimization>
30
+ )
31
+ add_compile_definitions (
32
+ $<$<CONFIG:Debug>:DEBUG>
33
+ )
34
+
35
+ add_library (geodesy)
36
+ target_include_directories (geodesy PUBLIC
37
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /include />
38
+ $<INSTALL_INTERFACE:include /geodesy>
39
+ )
40
+
41
+ add_subdirectory (src)
42
+
43
+ # Install headers at: $PREFIX/datetime/...
44
+ install (DIRECTORY ${CMAKE_SOURCE_DIR} /include /
45
+ DESTINATION include /geodesy
46
+ )
47
+
48
+ # install library
49
+ install (TARGETS geodesy
50
+ EXPORT geodesyTargets
51
+ ARCHIVE DESTINATION lib
52
+ LIBRARY DESTINATION lib
53
+ RUNTIME DESTINATION bin
54
+ )
55
+
56
+ install (EXPORT geodesyTargets
57
+ FILE geodesyTargets.cmake
58
+ NAMESPACE dso::
59
+ DESTINATION lib/cmake/geodesy
60
+ )
61
+ include (CMakePackageConfigHelpers)
62
+ write_basic_package_version_file(
63
+ "geodesyConfigVersion.cmake"
64
+ VERSION ${geodesy_version}
65
+ COMPATIBILITY AnyNewerVersion
66
+ )
67
+ install (FILES "geodesyConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR} /geodesyConfigVersion.cmake"
68
+ DESTINATION lib/cmake/dso
69
+ )
0 commit comments