1
+ ################################################################################################################################################################
2
+
3
+ # @project Library/Astrodynamics
4
+ # @file tutorials/cpp/sensor-modeling/CMakeLists.txt
5
+ # @author Lucas Brémond <lucas@loftorbital.com>
6
+ # @license TBD
7
+
8
+ ################################################################################################################################################################
9
+
10
+ ## Project Properties
11
+
12
+ SET (PROJECT_NAME "LibraryAstrodynamics" )
13
+ SET (PROJECT_DESCRIPTION "Sensor modeling tutorial." )
14
+ SET (PROJECT_PATH "Library/Astrodynamics" )
15
+ SET (PROJECT_PACKAGE_NAME "sensor-modeling" )
16
+ SET (PROJECT_LICENSE "TBD" )
17
+ SET (PROJECT_VENDOR_ID "org.open-space-collective" )
18
+ SET (PROJECT_VENDOR_NAME "Open Space Collective" )
19
+ SET (PROJECT_VENDOR_CONTACT "contact@open-space-collective.org" )
20
+ SET (PROJECT_VENDOR_URL "open-space-collective.org" )
21
+
22
+ ################################################################################################################################################################
23
+
24
+ ## Setup
25
+
26
+ ### Compatibility Check
27
+
28
+ CMAKE_MINIMUM_REQUIRED (VERSION "2.8.12" FATAL_ERROR )
29
+
30
+ ### Paths
31
+
32
+ SET (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR} /tools/cmake" )
33
+
34
+ ### Policies
35
+
36
+ CMAKE_POLICY (SET "CMP0048" NEW )
37
+
38
+ ################################################################################################################################################################
39
+
40
+ ## Project Configuration
41
+
42
+ PROJECT (${PROJECT_NAME} LANGUAGES "C" "CXX" )
43
+
44
+ SET (CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Limited Configs" FORCE )
45
+
46
+ IF (BUILD_CODE_COVERAGE )
47
+ SET (CMAKE_BUILD_TYPE "Debug" )
48
+ ELSEIF (NOT CMAKE_BUILD_TYPE )
49
+ SET (CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type [None|Debug|Release|RelWithDebInfo|MinSizeRel]." FORCE )
50
+ ENDIF ()
51
+
52
+ ################################################################################################################################################################
53
+
54
+ ## Flags
55
+
56
+ ### Warnings
57
+
58
+ IF (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
59
+
60
+ IF (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8 )
61
+
62
+ MESSAGE (FATAL_ERROR "GCC version must be at least 4.8" )
63
+
64
+ ENDIF ()
65
+
66
+ SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wshadow -Wno-deprecated -Wl,--no-undefined" )
67
+
68
+ ENDIF ()
69
+
70
+ ### C++ 14 support
71
+
72
+ SET (CMAKE_CXX_STANDARD 14 )
73
+ SET (CMAKE_CXX_STANDARD_REQUIRED ON )
74
+ SET (CMAKE_CXX_EXTENSIONS OFF )
75
+
76
+ ################################################################################################################################################################
77
+
78
+ ## Debugging Options
79
+
80
+ SET (CMAKE_VERBOSE_MAKEFILE 0 ) # Use 1 for debugging, 0 for release
81
+
82
+ ################################################################################################################################################################
83
+
84
+ ## Dependencies
85
+
86
+ ### Eigen [3]
87
+
88
+ FIND_PACKAGE ("Eigen3" REQUIRED )
89
+
90
+ IF (EIGEN3_FOUND )
91
+ INCLUDE_DIRECTORIES (${EIGEN3_INCLUDE_DIR} )
92
+ ELSE ()
93
+ MESSAGE (SEND_ERROR "[Eigen 3] not found." )
94
+ ENDIF ()
95
+
96
+ ### Library ▸ Core [master]
97
+
98
+ FIND_PACKAGE ("LibraryCore" "0.1" REQUIRED )
99
+
100
+ ### Library ▸ Mathematics [master]
101
+
102
+ FIND_PACKAGE ("LibraryMathematics" "0.1" REQUIRED )
103
+
104
+ ### Library ▸ Physics [master]
105
+
106
+ FIND_PACKAGE ("LibraryPhysics" "0.1" REQUIRED )
107
+
108
+ ### Library ▸ Astrodynamics [master]
109
+
110
+ FIND_PACKAGE ("LibraryAstrodynamics" "0.1" REQUIRED )
111
+
112
+ ################################################################################################################################################################
113
+
114
+ ## Targets
115
+
116
+ SET (APPLICATION_NAME "${PROJECT_PACKAGE_NAME} " )
117
+ SET (APPLICATION_TARGET "${APPLICATION_NAME} .exe" )
118
+
119
+ FILE (GLOB APPLICATION_HEADERS "${CMAKE_CURRENT_SOURCE_DIR} /*.hpp" )
120
+ FILE (GLOB APPLICATION_SRCS "${CMAKE_CURRENT_SOURCE_DIR} /*.cpp" "${CMAKE_CURRENT_SOURCE_DIR} /*.cxx" )
121
+
122
+ ADD_EXECUTABLE (${APPLICATION_TARGET} ${APPLICATION_SRCS} )
123
+
124
+ TARGET_LINK_LIBRARIES (${APPLICATION_TARGET} ${LibraryCore_LIBRARIES} )
125
+ TARGET_LINK_LIBRARIES (${APPLICATION_TARGET} ${LibraryMathematics_LIBRARIES} )
126
+ TARGET_LINK_LIBRARIES (${APPLICATION_TARGET} ${LibraryPhysics_LIBRARIES} )
127
+ TARGET_LINK_LIBRARIES (${APPLICATION_TARGET} ${LibraryAstrodynamics_LIBRARIES} )
128
+
129
+ ################################################################################################################################################################
0 commit comments