@@ -5,69 +5,73 @@ project(RocketCode2020 C CXX)
5
5
cmake_host_system_information (RESULT _memfree QUERY AVAILABLE_PHYSICAL_MEMORY )
6
6
set_property (GLOBAL PROPERTY JOB_POOLS four_jobs=4 )
7
7
if (_memfree LESS 1000 )
8
- set (CMAKE_JOB_POOL_COMPILE four_jobs )
9
- endif ()
8
+ set (CMAKE_JOB_POOL_COMPILE four_jobs )
9
+ endif ()
10
10
11
11
add_subdirectory (./libraries )
12
12
13
+ if (DEFINED ENV{DESKTOP_COMPAT} OR DESKTOP_COMPAT )
14
+ add_compile_definitions (DESKTOP_COMPAT=$ENV{DESKTOP_COMPAT} )
15
+ endif ()
16
+
13
17
if (DEFINED ENV{HOTFIRE_TEST} OR HOTFIRE_TEST )
14
- add_compile_definitions (HOTFIRE_TEST=$ENV{HOTFIRE_TEST} )
15
- endif ()
18
+ add_compile_definitions (HOTFIRE_TEST=$ENV{HOTFIRE_TEST} )
19
+ endif ()
16
20
17
21
if (DEFINED ENV{USE_LOGGER} OR USE_LOGGER )
18
- add_compile_definitions (USE_LOGGER=$ENV{USE_LOGGER} )
19
- endif ()
22
+ add_compile_definitions (USE_LOGGER=$ENV{USE_LOGGER} )
23
+ endif ()
20
24
21
25
if (DEFINED ENV{USE_SOCKET_CLIENT} OR USE_SOCKET_CLIENT )
22
- add_compile_definitions (USE_SOCKET_CLIENT=$ENV{USE_SOCKET_CLIENT} )
23
- endif ()
26
+ add_compile_definitions (USE_SOCKET_CLIENT=$ENV{USE_SOCKET_CLIENT} )
27
+ endif ()
24
28
25
29
if (DEFINED ENV{USE_INPUT} OR USE_INPUT )
26
- add_compile_definitions (USE_INPUT=$ENV{USE_INPUT} )
27
- endif ()
30
+ add_compile_definitions (USE_INPUT=$ENV{USE_INPUT} )
31
+ endif ()
28
32
29
33
if (DEFINED ENV{SKIP_INIT} OR SKIP_INIT )
30
- add_compile_definitions (SKIP_INIT=$ENV{SKIP_INIT} )
31
- endif ()
34
+ add_compile_definitions (SKIP_INIT=$ENV{SKIP_INIT} )
35
+ endif ()
32
36
33
37
if (DEFINED ENV{TESTING} OR TESTING )
34
- add_compile_definitions (TESTING=$ENV{TESTING} )
35
- endif ()
38
+ add_compile_definitions (TESTING=$ENV{TESTING} )
39
+ endif ()
36
40
37
41
# Sensors
38
42
39
43
if (DEFINED ENV{USE_SBG} OR USE_SBG )
40
- add_compile_definitions (USE_SBG=$ENV{USE_SBG} )
41
- endif ()
44
+ add_compile_definitions (USE_SBG=$ENV{USE_SBG} )
45
+ endif ()
42
46
43
47
if (DEFINED ENV{USE_RADIO} OR USE_RADIO )
44
- add_compile_definitions (USE_RADIO=$ENV{USE_RADIO} )
45
- endif ()
48
+ add_compile_definitions (USE_RADIO=$ENV{USE_RADIO} )
49
+ endif ()
46
50
47
51
if (DEFINED ENV{USE_WIRING_Pi} OR USE_WIRING_Pi )
48
- add_compile_definitions (USE_WIRING_Pi=$ENV{USE_WIRING_Pi} )
49
- endif ()
52
+ add_compile_definitions (USE_WIRING_Pi=$ENV{USE_WIRING_Pi} )
53
+ endif ()
50
54
51
55
if (DEFINED ENV{USE_GPIO} OR USE_GPIO )
52
- add_compile_definitions (USE_GPIO=$ENV{USE_GPIO} )
53
- endif ()
56
+ add_compile_definitions (USE_GPIO=$ENV{USE_GPIO} )
57
+ endif ()
54
58
55
59
if (DEFINED ENV{USE_ARDUINO_PROXY} OR USE_ARDUINO_PROXY )
56
- add_compile_definitions (USE_ARDUINO_PROXY=$ENV{USE_ARDUINO_PROXY} )
57
- endif ()
60
+ add_compile_definitions (USE_ARDUINO_PROXY=$ENV{USE_ARDUINO_PROXY} )
61
+ endif ()
58
62
59
63
# ---------------
60
64
# Main executable
61
65
# ---------------
62
- find_package (Threads )
66
+ find_package (Threads )
63
67
64
68
if (DEFINED ENV{SERVO_CONTROL} OR SERVO_CONTROL )
65
- file (GLOB_RECURSE MAIN_CONFIG_SRC ${PROJECT_SOURCE_DIR} /projects/ServoControl/*.cpp )
69
+ file (GLOB_RECURSE MAIN_CONFIG_SRC ${PROJECT_SOURCE_DIR} /projects/ServoControl/*.cpp )
66
70
elseif (DEFINED ENV{HOTFIRE_TEST} OR HOTFIRE_TEST )
67
- file (GLOB_RECURSE MAIN_CONFIG_SRC ${PROJECT_SOURCE_DIR} /projects/HotFire/*.cpp )
68
- else ()
69
- file (GLOB_RECURSE MAIN_CONFIG_SRC ${PROJECT_SOURCE_DIR} /projects/OctoberSky1/*.cpp )
70
- endif ()
71
+ file (GLOB_RECURSE MAIN_CONFIG_SRC ${PROJECT_SOURCE_DIR} /projects/HotFire/*.cpp )
72
+ else ()
73
+ file (GLOB_RECURSE MAIN_CONFIG_SRC ${PROJECT_SOURCE_DIR} /projects/OctoberSky1/*.cpp )
74
+ endif ()
71
75
72
76
file (GLOB_RECURSE SRC_MAIN ${PROJECT_SOURCE_DIR} /src/*.cpp )
73
77
@@ -78,43 +82,43 @@ target_include_directories(MainLoopLib PUBLIC ./src/)
78
82
target_precompile_headers (MainLoopLib PUBLIC ${PROJECT_SOURCE_DIR} /src/common/pch.h )
79
83
80
84
if (DEFINED ENV{SERVO_CONTROL} OR SERVO_CONTROL )
81
- target_include_directories (MainLoopLib PUBLIC
82
- ./projects/ServoControl/
83
- )
84
- target_include_directories (MainLoopLib PUBLIC
85
- ./projects/HotFire/
86
- )
85
+ target_include_directories (MainLoopLib PUBLIC
86
+ ./projects/ServoControl/
87
+ )
88
+ target_include_directories (MainLoopLib PUBLIC
89
+ ./projects/HotFire/
90
+ )
87
91
elseif (DEFINED ENV{HOTFIRE_TEST} OR HOTFIRE_TEST )
88
- target_include_directories (MainLoopLib PUBLIC
89
- ./projects/HotFire/
90
- )
91
- else ()
92
- target_include_directories (MainLoopLib PUBLIC
93
- ./projects/OctoberSky1/
94
- )
95
- endif ()
92
+ target_include_directories (MainLoopLib PUBLIC
93
+ ./projects/HotFire/
94
+ )
95
+ else ()
96
+ target_include_directories (MainLoopLib PUBLIC
97
+ ./projects/OctoberSky1/
98
+ )
99
+ endif ()
96
100
97
101
target_link_libraries (MainLoopLib sbgECom )
98
102
add_dependencies (MainLoopLib sbgECom )
99
103
100
104
target_link_libraries (MainLoopLib WiringPi )
101
105
add_dependencies (MainLoopLib WiringPi )
102
106
103
- if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm" )
104
-
105
- target_include_directories (MainLoopLib PUBLIC "$ENV{BOOST_DIRECTORY} " )
106
- target_link_directories (MainLoopLib PUBLIC "$ENV{BOOST_DIRECTORY} /stage/lib" )
107
- target_link_libraries (MainLoopLib boost_filesystem boost_system )
108
-
109
- target_include_directories (MainLoopLib PUBLIC "$ENV{LIBI2C_DIRECTORY} /include" )
110
- target_link_directories (MainLoopLib PUBLIC "$ENV{LIBI2C_DIRECTORY} /lib" )
111
-
112
- else ()
113
- target_link_libraries (MainLoopLib systemd )
114
- find_package (Boost 1.65.1 COMPONENTS system filesystem REQUIRED )
115
- target_include_directories (MainLoopLib PUBLIC ${Boost_INCLUDE_DIRS} )
116
- target_link_libraries (MainLoopLib ${Boost_LIBRARIES} )
117
- endif ()
107
+ if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm" )
108
+
109
+ target_include_directories (MainLoopLib PUBLIC "$ENV{BOOST_DIRECTORY} " )
110
+ target_link_directories (MainLoopLib PUBLIC "$ENV{BOOST_DIRECTORY} /stage/lib" )
111
+ target_link_libraries (MainLoopLib boost_filesystem boost_system )
112
+
113
+ target_include_directories (MainLoopLib PUBLIC "$ENV{LIBI2C_DIRECTORY} /include" )
114
+ target_link_directories (MainLoopLib PUBLIC "$ENV{LIBI2C_DIRECTORY} /lib" )
115
+
116
+ else ()
117
+ target_link_libraries (MainLoopLib systemd )
118
+ find_package (Boost 1.65.1 COMPONENTS system filesystem REQUIRED )
119
+ target_include_directories (MainLoopLib PUBLIC ${Boost_INCLUDE_DIRS} )
120
+ target_link_libraries (MainLoopLib ${Boost_LIBRARIES} )
121
+ endif ()
118
122
119
123
target_link_libraries (MainLoopLib i2c )
120
124
@@ -124,9 +128,9 @@ target_link_libraries(MainLoopLib protobufDef)
124
128
125
129
target_link_libraries (MainLoopLib cobs-c )
126
130
127
- target_link_libraries (MainLoopLib ${CMAKE_THREAD_LIBS_INIT} )
131
+ target_link_libraries (MainLoopLib ${CMAKE_THREAD_LIBS_INIT} )
128
132
129
- target_link_libraries (MainLoopLib i2c )
133
+ target_link_libraries (MainLoopLib i2c )
130
134
add_executable (MainLoop ./src/init/MainLoop.cpp )
131
135
target_link_libraries (MainLoop MainLoopLib )
132
136
0 commit comments