-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
263 lines (236 loc) · 8.35 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
cmake_minimum_required(VERSION 3.0)
PROJECT(OST-MODULES C CXX)
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
add_compile_options(-fno-sized-deallocation)
add_compile_options(-fPIC)
#get_cmake_property(_variableNames VARIABLES)
#list (SORT _variableNames)
#foreach (_variableName ${_variableNames})
# message(STATUS "${_variableName}=${${_variableName}}")
#endforeach()
set(THREADS_PREFER_PTHREAD_FLAG ON)
#find_package(Qt5Core)
find_package(CFITSIO REQUIRED)
find_package(INDI REQUIRED)
#find_package(INDI COMPONENTS clientqt5 REQUIRED)
find_package(ZLIB REQUIRED)
find_package(Threads REQUIRED)
find_package(Nova REQUIRED)
find_package(GSL REQUIRED)
find_package(OpenCV REQUIRED )
find_package(WCSLIB REQUIRED)
find_package(QT NAMES Qt5 COMPONENTS Gui Widgets Core Concurrent Network WebSockets Sql Scxml Multimedia REQUIRED)
find_package(Qt5 5.15.2 REQUIRED COMPONENTS Gui Widgets Core Concurrent Network WebSockets Sql Multimedia Scxml)
find_package(StellarSolver REQUIRED)
find_package(OSTSERVER REQUIRED)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/modules)
include_directories(${INDI_INCLUDE_DIR})
include_directories(${CFITSIO_INCLUDE_DIR})
include_directories(${GSL_INCLUDE_DIRS})
include_directories(${Qt5_DIR})
include_directories(${QT5Declarative_INCLUDE_LIBRARIES} )
include_directories(${QT5Declarative_INCLUDE_DIRS} )
include_directories(${STELLARSOLVER_INCLUDE_DIR})
include_directories(${OST_INCLUDE_DIR}/ost)
message(STATUS "OST_INCLUDE_DIR=${OST_INCLUDE_DIR}")
include(CMakeCommon)
# Focus module
#list (APPEND RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/modules/focus/focus.qrc)
#qt5_add_resources (RCC_SOURCES ${RESOURCES})
add_library(ostfocus SHARED
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/focus/focus.h
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/focus/focus.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/focus/focus.qrc
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/focus/polynomialfit.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/focus/polynomialfit.h
${RCC_SOURCES}
)
target_link_libraries(ostfocus PRIVATE
${OST_LIBRARY_INDI}
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Concurrent
Qt${QT_VERSION_MAJOR}::Widgets
Qt${QT_VERSION_MAJOR}::Scxml
Threads::Threads
z
)
target_compile_definitions(ostfocus PRIVATE FOCUS_MODULE)
# guider module
add_library(ostguider SHARED
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/guider/guider.h
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/guider/guider.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/guider/guider.qrc
)
target_link_libraries(ostguider PRIVATE
${OST_LIBRARY_INDI}
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Concurrent
Qt${QT_VERSION_MAJOR}::Widgets
Threads::Threads
z
)
target_compile_definitions(ostguider PRIVATE GUIDER_MODULE)
# polar module
add_library(ostpolar SHARED
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/polar/polar.h
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/polar/polar.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/polar/rotations.h
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/polar/rotations.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/polar/polar.qrc
)
target_link_libraries(ostpolar PRIVATE
${OST_LIBRARY_INDI}
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Concurrent
Qt${QT_VERSION_MAJOR}::Widgets
Threads::Threads
z
)
target_compile_definitions(ostpolar PRIVATE POLAR_MODULE)
# inspector module
add_library(ostinspector SHARED
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/inspector/inspector.h
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/inspector/inspector.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/inspector/inspector.qrc
)
target_link_libraries(ostinspector PRIVATE
${OST_LIBRARY_INDI}
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Concurrent
Qt${QT_VERSION_MAJOR}::Widgets
Threads::Threads
z
)
target_compile_definitions(ostinspector PRIVATE INSPECTOR_MODULE)
# Allsky module
add_library(ostallsky SHARED
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/allsky/allsky.h
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/allsky/allsky.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/allsky/allsky.qrc
)
target_link_libraries(ostallsky PRIVATE
${OST_LIBRARY_INDI}
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Concurrent
Qt${QT_VERSION_MAJOR}::Widgets
Threads::Threads
z
)
target_compile_definitions(ostallsky PRIVATE ALLSKY_MODULE)
# sequencer module
add_library(ostsequencer SHARED
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/sequencer/sequencer.h
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/sequencer/sequencer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/sequencer/sequencer.qrc
)
target_link_libraries(ostsequencer PRIVATE
${OST_LIBRARY_INDI}
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Concurrent
Qt${QT_VERSION_MAJOR}::Widgets
Threads::Threads
z
)
target_compile_definitions(ostsequencer PRIVATE SEQUENCER_MODULE)
# navigator module
add_library(ostnavigator SHARED
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/navigator/navigator.h
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/navigator/navigator.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/navigator/navigator.qrc
)
target_link_libraries(ostnavigator PRIVATE
${OST_LIBRARY_INDI}
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Concurrent
Qt${QT_VERSION_MAJOR}::Widgets
Threads::Threads
z
)
target_compile_definitions(ostnavigator PRIVATE NAVIGATOR_MODULE)
# meteo module
add_library(ostmeteo SHARED
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/meteo/meteo.h
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/meteo/meteo.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/meteo/meteo.qrc
)
target_link_libraries(ostmeteo PRIVATE
${OST_LIBRARY_INDI}
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Concurrent
Qt${QT_VERSION_MAJOR}::Widgets
Threads::Threads
z
)
target_compile_definitions(ostmeteo PRIVATE METEO_MODULE)
# Blind periodic error correction module
add_library(ostblindpec SHARED
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/blindpec/blindpec.h
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/blindpec/blindpec.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/blindpec/blindpec.qrc
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/blindpec/CV_SubPix.h
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/blindpec/CV_SubPix.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/blindpec/tacquisitionvideo.h
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/blindpec/tacquisitionvideo.cpp
)
target_link_libraries(ostblindpec PRIVATE
${OST_LIBRARY_INDI}
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Concurrent
Qt${QT_VERSION_MAJOR}::Widgets
Qt${QT_VERSION_MAJOR}::Multimedia
${OpenCV_LIBS}
Threads::Threads
z
)
target_compile_definitions(ostblindpec PRIVATE BLINDPEC_MODULE)
# darkassist module
add_library(ostdarkassist SHARED
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/darkassist/darkassist.h
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/darkassist/darkassist.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/darkassist/darkassist.qrc
)
target_link_libraries(ostdarkassist PRIVATE
${OST_LIBRARY_INDI}
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Concurrent
Qt${QT_VERSION_MAJOR}::Widgets
Threads::Threads
z
)
target_compile_definitions(ostdarkassist PRIVATE DARKASSIST_MODULE)
install(TARGETS
ostallsky
ostinspector
ostnavigator
ostguider
ostfocus
ostsequencer
ostmeteo
ostpolar
ostblindpec
ostdarkassist
RUNTIME DESTINATION "/usr/bin"
LIBRARY DESTINATION "/usr/lib"
)
#get_cmake_property(_variableNames VARIABLES)
#list (SORT _variableNames)
#foreach (_variableName ${_variableNames})
# message(STATUS "${_variableName}=${${_variableName}}")
#endforeach()
#message(STATUS "OST_FOUND=${OST_FOUND}")
#message(STATUS "OST_LIBRARY=${OST_LIBRARY}")
#message(STATUS "OST_INCLUDE_DIR=${OST_INCLUDE_DIR}")
#message(STATUS "OST_LIBRARY_BASE=${OST_LIBRARY_BASE}")
#message(STATUS "OST_LIBRARY_INDI=${OST_LIBRARY_INDI}")