-
-
Notifications
You must be signed in to change notification settings - Fork 96
/
Copy pathCMakeLists.txt
382 lines (342 loc) · 9.24 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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
set(PROJECT_NAME DeepSkyStacker)
message("Configuring project: " ${PROJECT_NAME})
set(COMPILE_WARNING_AS_ERROR YES)
SET (CMAKE_INSTALL_BINDIR ".")
qt_standard_project_setup()
set(CMAKE_AUTORCC ON)
################################################################################
# Source groups
################################################################################
set(Dialogs
"About.cpp"
"ExplorerBar.cpp"
)
source_group("Dialogs" FILES ${Dialogs})
set(Dialogs__Processing
"BezierAdjust.h"
"processingcontrols.cpp"
"ProcessingDlg.cpp"
"ProcessingSettings.h"
"ProcessingSettingsDlg.cpp"
"RGBTab.cpp"
"SavePicture.cpp"
"StarMaskDlg.cpp"
)
source_group("Dialogs\\Processing" FILES ${Dialogs__Processing})
set(Dialogs__Registering
"AskRegistering.cpp"
"RegisterSettings.cpp"
)
source_group("Dialogs\\Registering" FILES ${Dialogs__Registering})
set(Dialogs__Settings
"AlignmentParameters.cpp"
"CometStacking.cpp"
"IntermediateFiles.cpp"
"OutputTab.cpp"
"PostCalibration.cpp"
"RawDDPSettings.cpp"
"ResultParameters.cpp"
"StackingParameters.cpp"
"StackSettings.cpp"
)
source_group("Dialogs\\Settings" FILES ${Dialogs__Settings})
set(Dialogs__Stacking
"BackgroundOptions.cpp"
"BatchStacking.cpp"
"CheckAbove.cpp"
"DropFilesDlg.cpp"
"ImageProperties.cpp"
"picturelist.cpp"
"RecommendedSettings.cpp"
"RenameGroup.cpp"
"SaveEditChanges.cpp"
"StackingDlg.cpp"
"StackRecap.cpp"
)
source_group("Dialogs\\Stacking" FILES ${Dialogs__Stacking})
set(Header_Files
"../DeepSkyStackerKernel/histogram.h"
"Delaunay.h"
"dslr.h"
"DSS-versionhelpers.h"
"DSS-winapifamily.h"
"DSS-winpackagefamily.h"
"lowerdockwidget.cpp"
"mrulist.h"
"StdAfx.h"
)
source_group("Header Files" FILES ${Header_Files})
set(Source_Files
"BaseDialog.cpp"
"DeepSkyStacker.cpp"
"Delaunay.cpp"
"editstars.cpp"
"progressdlg.cpp"
"selectrect.cpp"
"toolbar.cpp"
)
source_group("Source Files" FILES ${Source_Files})
set(Ui_Files
"ui/About.ui"
"ui/AlignmentParameters.ui"
"ui/AskRegistering.ui"
"ui/BackgroundOptions.ui"
"ui/BatchStacking.ui"
"ui/CheckAbove.ui"
"ui/CometStacking.ui"
"ui/DropFilesDlg.ui"
"ui/ExplorerBar.ui"
"ui/ImageProperties.ui"
"ui/IntermediateFiles.ui"
"ui/OutputTab.ui"
"ui/PictureList.ui"
"ui/PostCalibration.ui"
"ui/ProcessingControls.ui"
"ui/ProcessingDlg.ui"
"ui/ProcessingSettingsDlg.ui"
"ui/ProgressDlg.ui"
"ui/RawDDPSettings.ui"
"ui/RecommendedSettings.ui"
"ui/RegisterSettings.ui"
"ui/RenameGroup.ui"
"ui/ResultParameters.ui"
"ui/SaveEditChanges.ui"
"ui/StackingDlg.ui"
"ui/StackingParameters.ui"
"ui/StackRecap.ui"
"ui/StackSettings.ui"
"ui/StarMaskDlg.ui"
)
source_group("Qt\\ui" FILES ${Ui_Files})
set(i18n_Files
"i18n/DSS_ca.ts"
"i18n/DSS_cs.ts"
"i18n/DSS_de.ts"
"i18n/DSS_en.ts"
"i18n/DSS_es.ts"
"i18n/DSS_fr.ts"
"i18n/DSS_it.ts"
"i18n/DSS_ja_JP.ts"
"i18n/DSS_nl.ts"
"i18n/DSS_pt_BR.ts"
"i18n/DSS_ro.ts"
"i18n/DSS_ru.ts"
"i18n/DSS_tr.ts"
"i18n/DSS_zh_CN.ts"
"i18n/DSS_zh_TW.ts"
)
source_group("Qt\\i18n" FILES ${i18n_Files} "i18n/translations.qrc"
)
set(Resources
"Icon.rc"
"Icon/app.ico"
"resources.qrc"
"Version.rc"
)
source_group("Resources" FILES ${Resources} )
set(Tools
"../Tools/imageview.cpp"
"../Tools/QElidedLabel.cpp"
"../Tools/QLinearGradientCtrl.cpp"
)
source_group("Tools" FILES ${Tools})
set(ALL_FILES
${Dialogs}
${Dialogs__Processing}
${Dialogs__Registering}
${Dialogs__Settings}
${Dialogs__Stacking}
${Header_Files}
${Ui_Files}
${i18n_Files} "i18n/translations.qrc"
${Resources}
${Source_Files}
${Tools}
)
################################################################################
# Target
################################################################################
qt_add_executable(DeepSkyStacker ${ALL_FILES})
set_source_files_properties(${i18n_Files}
PROPERTIES OUTPUT_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/i18n")
qt_add_lrelease(TS_FILES ${i18n_Files})
set_target_properties(DeepSkyStacker PROPERTIES
INTERPROCEDURAL_OPTIMIZATION_RELEASE "TRUE"
)
set_target_properties(DeepSkyStacker PROPERTIES
WIN32_EXECUTABLE ON
MACOSX_BUNDLE ON
)
################################################################################
# Include directories
################################################################################
target_include_directories(DeepSkyStacker PUBLIC
.
../DeepSkyStackerKernel
GeneratedFiles/$<CONFIG>
GeneratedFiles
../LibRaw
../ZClass
../Tools
)
if(WIN32)
target_include_directories(${PROJECT_NAME} PUBLIC
../Zlib
../LibTiff
../CFitsIO
../include
../include/exiv2
../include/SmtpMime
"$<$<CONFIG:Debug>:C:/Program Files (x86)/Visual Leak Detector/include>"
"$ENV{Boost_1_80_0}"
)
endif()
target_precompile_headers(DeepSkyStacker PRIVATE
stdafx.h
)
################################################################################
# Compile definitions
################################################################################
target_compile_definitions(DeepSkyStacker PRIVATE
"$<$<CONFIG:Debug>:Z_TRACE_DEVELOP>"
"$<$<CONFIG:Release>:NDEBUG>"
NOMINMAX
LIBRAW_NODLL
_CRT_SECURE_NO_DEPRECATE
USE_LIBTIFF_STATIC
)
################################################################################
# Compile and link options
################################################################################
if(MSVC)
target_compile_options(DeepSkyStacker PRIVATE
$<$<CONFIG:Debug>:
/Gm-;
/Zi
>
$<$<CONFIG:Release>:
/Zi;
/GS-
>
-W4 /wd4244 /wd4652 /wd4702 /wd4828
-Zc:__cplusplus /openmp:experimental
/MP;
/GL-;
/EHsc
)
target_link_options(DeepSkyStacker PRIVATE
$<$<CONFIG:Debug>:
/PROFILE
>
$<$<CONFIG:Release>:
/OPT:ICF
>
/DEBUG:FULL;
/MACHINE:X64;
/SUBSYSTEM:WINDOWS;
/DYNAMICBASE:NO
)
endif()
if(WIN32)
target_link_directories(DeepSkyStacker PRIVATE
"$<$<CONFIG:Debug>:C:/Users/amonra/Documents/GitHub/DSS/libs/Win64/DebugLibs>"
"$<$<CONFIG:Release>:C:/Users/amonra/Documents/GitHub/DSS/libs/Win64/ReleaseLibs>"
"$<$<CONFIG:Debug>:C:/Program Files (x86)/Visual Leak Detector/lib/Win64>"
)
endif()
################################################################################
# Dependencies
################################################################################
# Link with other targets.
target_link_libraries(DeepSkyStacker PRIVATE
Qt6::Core
Qt6::Widgets
Qt6::Network
DeepSkyStackerKernel
libraw
libtiff
ZClass
)
set(DEBUG_DEPENDENCIES exiv2d libexpatd zlibstaticd)
set(RELEASE_DEPENDENCIES exiv2 libexpat zlibstatic)
set(ADDITIONAL_LIBRARY_DEPENDENCIES
"$<$<CONFIG:Debug>:${DEBUG_DEPENDENCIES}>"
"$<$<CONFIG:Release>:${RELEASE_DEPENDENCIES}>"
"cfitsio"
)
if(WIN32)
set(ADDITIONAL_LIBRARY_DEPENDENCIES ${ADDITIONAL_LIBRARY_DEPENDENCIES}
user32
psapi
htmlhelp
)
endif()
target_link_libraries(${PROJECT_NAME} PRIVATE "${ADDITIONAL_LIBRARY_DEPENDENCIES}")
#
# Force the values of QT_DEPLOY... variables
#
set (QT_DEPLOY_BIN_DIR ".")
set (QT_DEPLOY_LIBEXEC_DIR ".")
set (QT_DEPLOY_LIB_DIR ".")
set (QT_DEPLOY_PLUGINS_DIR ".")
#
# Set options for the deployment script. The value of:
#
# --libdir .
#
# is set to work around a bug in qt_deploy_runtime_dependencies which uses
#
# --libdir bin
#
# even though QT_DEPLOY_LIB_DIR is set to .
#
set (deploy_tool_options_arg "--libdir .")
if(APPLE)
set(deploy_tool_options_arg "${deploy_tool_options_arg} --hardened-runtime")
elseif(WIN32)
set(deploy_tool_options_arg "${deploy_tool_options_arg} --pdb")
endif()
# Generate a deployment script to be executed at install time
# App bundles on macOS have an .app suffix
if(APPLE)
set(executable_path "$<TARGET_FILE_NAME:DeepSkyStacker>.app")
else()
message ("Qt Deploy Bin Dir: " ${QT_DEPLOY_BIN_DIR})
message ("Qt Deploy Lib Dir: " ${QT_DEPLOY_LIB_DIR})
message ("Target filename:" $<TARGET_FILE_NAME:DeepSkyStacker>)
set(executable_path "${QT_DEPLOY_BIN_DIR}/$<TARGET_FILE_NAME:DeepSkyStacker>")
endif()
message ("executable_path: " ${executable_path})
message ("deploy tools options arg: " ${deploy_tool_options_arg})
qt_generate_deploy_script(
TARGET DeepSkyStacker
OUTPUT_SCRIPT deploy_script
CONTENT "
qt_deploy_runtime_dependencies(
EXECUTABLE \"${executable_path}\"
DEPLOY_TOOL_OPTIONS ${deploy_tool_options_arg}
)"
)
INSTALL (TARGETS DeepSkyStacker)
INSTALL (SCRIPT ${deploy_script})
#[=[
if(WIN32)
################################################################################
# Post build events
################################################################################
set (deployment_string
${WINDEPLOYQT_EXECUTABLE} " --verbose 2 --dir . --plugindir plugins "
"--compiler-runtime --pdb "
$<TARGET_FILE_NAME:DeepSkyStacker>
)
message ("Deployment command: " ${deployment_string})
ADD_CUSTOM_COMMAND(
TARGET DeepSkyStacker
POST_BUILD
COMMAND
${WINDEPLOYQT_EXECUTABLE} --verbose 2 --dir . --plugindir plugins
--compiler-runtime --pdb
$<TARGET_FILE_NAME:DeepSkyStacker>
)
endif()
]=]