-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
181 lines (164 loc) · 5.43 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
#
# for the project to work, THIRDPARTY_HOME must be set to the path where dependencies are located
#
cmake_minimum_required(VERSION 3.12)
project(schlazicontrol)
set(TOOLCHAIN_INCLUDED ON CACHE BOOL "" FORCE)
set(TOOLCHAIN_HOME "C:/Users/lordjaxom/Programme/gcc-4.9.2-glibc-2.19")
set(THIRDPARTY_HOME "C:/Users/lordjaxom/Projekte/_RASPI_THIRDPARTY")
include(Toolchain.cmake)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake")
set(BOOST_ROOT "${THIRDPARTY_HOME}/boost_1_68_0")
set(Asio_ROOT "${THIRDPARTY_HOME}/asio-1.12.1/include")
set(Json_ROOT "${THIRDPARTY_HOME}/json-master/include")
# for Raspberry Pi:
# set(WiringPi_ROOT "${THIRDPARTY_HOME}/wiringPi")
# for Banana Pi:
set(WiringPi_ROOT "${THIRDPARTY_HOME}/BPI-WiringPi2/wiringPi")
set(Mosquitto_ROOT "${THIRDPARTY_HOME}/mosquitto-1.5.4/lib")
set(RpiWs281x_ROOT "${THIRDPARTY_HOME}/rpi_ws281x")
set(Boost_INCLUDE_DIRS "${BOOST_ROOT}")
find_package(Asio REQUIRED)
find_package(Json REQUIRED)
set(TYPESTRING_ROOT "${THIRDPARTY_HOME}/typestring-master")
include_directories("${TYPESTRING_ROOT}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++14")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
set(SOURCE_FILES
core/commandline.cpp
core/commandline.hpp
core/component.cpp
core/component.hpp
core/config.hpp
core/input.cpp
core/input.hpp
core/logging.cpp
core/logging.hpp
core/manager.cpp
core/manager.hpp
core/output.cpp
core/output.hpp
core/properties.cpp
core/properties.hpp
utility/optional.hpp
utility/string_view.hpp)
find_package(WiringPi)
if(WiringPi_FOUND)
set(SOURCE_FILES ${SOURCE_FILES}
modules/wiringPi/wiringPi.cpp
modules/wiringPi/wiringPi.hpp
modules/wiringPi/input_gpio.cpp
modules/wiringPi/input_gpio.hpp
modules/wiringPi/output_pwm.cpp
modules/wiringPi/output_pwm.hpp)
set(MODULE_INCLUDE_DIRS ${MODULE_INCLUDE_DIRS} ${WiringPi_INCLUDE_DIRS})
set(MODULE_LIBRARIES ${MODULE_LIBRARIES} ${WiringPi_LIBRARIES})
message("Module wiringPi: true")
else()
message("Module wiringPi: false")
endif()
find_package(Mosquitto)
if(Mosquitto_FOUND)
set(SOURCE_FILES ${SOURCE_FILES}
modules/mqtt/mqtt.cpp
modules/mqtt/mqtt.hpp
modules/mqtt/input_subscribe.cpp
modules/mqtt/input_subscribe.hpp
modules/mqtt/output_publish.cpp
modules/mqtt/output_publish.hpp)
set(MODULE_INCLUDE_DIRS ${MODULE_INCLUDE_DIRS} ${Mosquitto_INCLUDE_DIRS})
set(MODULE_LIBRARIES ${MODULE_LIBRARIES} ${Mosquitto_LIBRARIES})
message("Module mqtt: true")
else()
message("Module mqtt: false")
endif()
find_package(RpiWs281x)
if(RpiWs281x_FOUND)
set(SOURCE_FILES ${SOURCE_FILES}
modules/rpi_ws281x/output_ws281x.cpp
modules/rpi_ws281x/ws281x.cpp
modules/rpi_ws281x/ws281x.hpp)
set(MODULE_INCLUDE_DIRS ${MODULE_INCLUDE_DIRS} ${RpiWs281x_INCLUDE_DIRS})
set(MODULE_LIBRARIES ${MODULE_LIBRARIES} ${RpiWs281x_LIBRARIES})
message("Module rpi_ws281x: true")
else()
message("Module rpi_ws281x: false")
endif()
if(NOT WIN32)
set(SOURCE_FILES ${SOURCE_FILES}
modules/console/input_console.cpp
modules/console/input_console.hpp
modules/console/output_console.cpp
modules/console/output_console.hpp
modules/console/console.cpp
modules/console/console.hpp)
message("Module console: true")
else()
message("Module console: false")
endif()
file(GLOB CUSTOM_SOURCE_FILES custom/*.cpp custom/*.hpp)
if (CUSTOM_SOURCE_FILES)
set(SOURCE_FILES ${SOURCE_FILES} ${CUSTOM_SOURCE_FILES})
endif()
set(SOURCE_FILES ${SOURCE_FILES}
connection.cpp
connection.hpp
event.hpp
event.cpp
schlazicontrol.cpp
types.cpp
types.hpp
forward.hpp
transition.hpp
transition.cpp
transition_triggers.cpp
transition_triggers.hpp
expression.cpp
expression.hpp
timer.cpp
timer.hpp
triggers.cpp
triggers.hpp
transition_multiply.cpp
transition_multiply.hpp
transition_fade.cpp
transition_fade.hpp
typeinfo.hpp
scoped.hpp
scoped.cpp
statistics.hpp
transition_shift.cpp
transition_shift.hpp
multiconnection.cpp
multiconnection.hpp
trackable.cpp
trackable.hpp
utility_stream.hpp
utility_string.hpp
utility_math.hpp
utility_valuetable.hpp
utility_gamma.hpp
utility_colorwheel.hpp
transition_animate.cpp
transition_animate.hpp
transition_animate_waves.cpp
utility_graphics.cpp
utility_graphics.hpp
utility_ranged.hpp
transition_color.cpp
transition_color.hpp
transition_color_fill.cpp
transition_color_gradient.cpp)
add_executable(schlazicontrol ${SOURCE_FILES})
target_compile_definitions(schlazicontrol PRIVATE
${Asio_DEFINITIONS})
target_include_directories(schlazicontrol PRIVATE
${CMAKE_CURRENT_LIST_DIR}
${Boost_INCLUDE_DIRS}
${Asio_INCLUDE_DIRS}
${Json_INCLUDE_DIRS}
${typestring_INCLUDE_DIRS}
${MODULE_INCLUDE_DIRS})
target_link_libraries(schlazicontrol
${Asio_LIBRARIES}
${MODULE_LIBRARIES})