-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
301 lines (254 loc) · 13 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
#
# Copyright (c) 2010-2020, Gilles Caulier, <caulier dot gilles at gmail dot com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
project(PhotoLayoutsEditor)
cmake_minimum_required(VERSION "3.1.0")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_AUTOMOC ON)
option(ENABLE_DPLUGIN "Build digiKam plugin version of Photo Layouts Editor tool (default=OFF)" OFF)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
include(MacroInstall)
include(FeatureSummary)
# ThreadSanitizer
set(CMAKE_C_FLAGS_TSAN
"-fsanitize=thread -g -O1"
CACHE STRING "Flags used by the C compiler during ThreadSanitizer builds."
FORCE)
set(CMAKE_CXX_FLAGS_TSAN
"-fsanitize=thread -g -O1"
CACHE STRING "Flags used by the C++ compiler during ThreadSanitizer builds."
FORCE)
# AddressSanitize
set(CMAKE_C_FLAGS_ASAN
"-fsanitize=address -fno-optimize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointer -g -O0"
CACHE STRING "Flags used by the C compiler during AddressSanitizer builds."
FORCE)
set(CMAKE_CXX_FLAGS_ASAN
"-fsanitize=address -fno-optimize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointer -g -O0"
CACHE STRING "Flags used by the C++ compiler during AddressSanitizer builds."
FORCE)
# LeakSanitizer
set(CMAKE_C_FLAGS_LSAN
"-fsanitize=leak -fno-omit-frame-pointer -g -O1"
CACHE STRING "Flags used by the C compiler during LeakSanitizer builds."
FORCE)
set(CMAKE_CXX_FLAGS_LSAN
"-fsanitize=leak -fno-omit-frame-pointer -g -O1"
CACHE STRING "Flags used by the C++ compiler during LeakSanitizer builds."
FORCE)
# MemorySanitizer
set(CMAKE_C_FLAGS_MSAN
"-fsanitize=memory -fno-optimize-sibling-calls -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer -g -O2"
CACHE STRING "Flags used by the C compiler during MemorySanitizer builds."
FORCE)
set(CMAKE_CXX_FLAGS_MSAN
"-fsanitize=memory -fno-optimize-sibling-calls -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer -g -O2"
CACHE STRING "Flags used by the C++ compiler during MemorySanitizer builds."
FORCE)
# UndefinedBehaviour
set(CMAKE_C_FLAGS_UBSAN
"-fsanitize=undefined"
CACHE STRING "Flags used by the C compiler during UndefinedBehaviourSanitizer builds."
FORCE)
set(CMAKE_CXX_FLAGS_UBSAN
"-fsanitize=undefined"
CACHE STRING "Flags used by the C++ compiler during UndefinedBehaviourSanitizer builds."
FORCE)
find_package(Qt5 "5.6.0" REQUIRED
NO_MODULE COMPONENTS
Core
Widgets
Gui
Svg
Xml
PrintSupport
)
find_package(Threads)
find_package(DigikamCore
CONFIG REQUIRED)
set_package_properties(DigikamCore PROPERTIES
URL "http://www.digikam.org"
DESCRIPTION "digiKam core library"
)
include(i18nUtils)
include_directories($<TARGET_PROPERTY:Digikam::digikamcore,INTERFACE_INCLUDE_DIRECTORIES>/digikam
$<TARGET_PROPERTY:Qt5::Xml,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:Qt5::Svg,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:Qt5::Gui,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:Qt5::Core,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:Qt5::Widgets,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:Qt5::PrintSupport,INTERFACE_INCLUDE_DIRECTORIES>
${CMAKE_CURRENT_SOURCE_DIR}/src/extra
${CMAKE_CURRENT_SOURCE_DIR}/src/extra/qtpropertybrowser
${CMAKE_CURRENT_SOURCE_DIR}/src/threads
${CMAKE_CURRENT_SOURCE_DIR}/src/undo
${CMAKE_CURRENT_SOURCE_DIR}/src/common
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/canvas
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/dialogs
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/items
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/layers
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/tools
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/window
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/settings
${CMAKE_CURRENT_SOURCE_DIR}/src/models
${CMAKE_CURRENT_SOURCE_DIR}/src/listeners
${CMAKE_CURRENT_SOURCE_DIR}/src/effects
${CMAKE_CURRENT_SOURCE_DIR}/src/effects/tools
${CMAKE_CURRENT_SOURCE_DIR}/src/borders
${CMAKE_CURRENT_SOURCE_DIR}/src/borders/tools
${CMAKE_BINARY_DIR}/
)
add_subdirectory(data)
set(photolayoutseditorcore_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/src/borders/borderdrawerfactoryinterface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/borders/borderchangelistener.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/borders/borderdrawerinterface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/borders/borderdrawersloader.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/borders/bordersgroup.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/borders/tools/standardbordersfactory.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/borders/tools/polaroidborderdrawer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/borders/tools/solidborderdrawer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/effects/abstractphotoeffectfactory.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/effects/abstractphotoeffectinterface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/effects/photoeffectchangelistener.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/effects/photoeffectsgroup.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/effects/photoeffectsloader.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/effects/tools/standardeffectsfactory.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/effects/tools/blurphotoeffect.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/effects/tools/colorizephotoeffect.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/effects/tools/grayscalephotoeffect.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/effects/tools/sepiaphotoeffect.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/effects/tools/negativephotoeffect.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/threads/plecanvasloadingthread.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/threads/plecanvassavingthread.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/threads/plescenebackgroundloader.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/threads/plesceneborderloader.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/threads/abstractphotoitemloader.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/threads/imageloadingthread.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/threads/photoitemloader.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/threads/textitemloader.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/threads/progressevent.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/extra/pleglobal.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/extra/pleeditfactory.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/extra/qtpropertybrowser/qtbuttonpropertybrowser.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/extra/qtpropertybrowser/qteditorfactory.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/extra/qtpropertybrowser/qtgroupboxpropertybrowser.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/extra/qtpropertybrowser/qtpropertybrowser.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/extra/qtpropertybrowser/qtpropertybrowserutils.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/extra/qtpropertybrowser/qtpropertymanager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/extra/qtpropertybrowser/qttreepropertybrowser.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/extra/qtpropertybrowser/qtvariantproperty.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/undo/undomoverowscommand.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/undo/undoremoveitem.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/undo/undocommandevent.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/undo/undocommandeventfilter.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/layers/layerstree.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/layers/layerstreedelegate.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/layers/layerstreemenu.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/layers/layersmodel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/layers/layersmodelitem.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/layers/layersselectionmodel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/tools/abstractitemslistviewtool.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/tools/abstractitemstool.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/tools/abstracttool.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/tools/abstractmovablemodel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/tools/borderedittool.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/tools/plecanvasedittool.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/tools/effectseditortool.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/tools/texteditortool.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/tools/toolsdockwidget.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/tools/zoomtool.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/tools/patternscombobox.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/dialogs/plecanvassizedialog.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/dialogs/plecanvasnewdialog.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/dialogs/plecanvassizewidget.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/dialogs/pleconfigdialog.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/dialogs/gridsetupdialog.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/dialogs/templatesmodel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/dialogs/templatesview.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/window/plewindow.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/window/plestatusbar.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/items/textcolorchangelistener.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/items/textfontchangelistener.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/items/textitem.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/items/abstractphoto.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/items/abstractphoto_p.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/items/abstractiteminterface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/items/photoitem.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/canvas/plecanvas.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/canvas/plecanvassize.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/canvas/plescenebackground.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/canvas/plesceneborder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/canvas/plescene.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/canvas/cropwidgetitem.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/canvas/mousepresslistener.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/canvas/rotationwidgetitem.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/canvas/scalingwidgetitem.cpp
${i18n_QRC_SRCS}
${i18n_QM}
)
qt5_add_resources(photolayoutseditorcore_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/res/icons.qrc
${CMAKE_CURRENT_SOURCE_DIR}/src/extra/qtpropertybrowser/qtpropertybrowser.qrc
)
qt5_wrap_ui(photolayoutseditorcore_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/window/plewindow.ui
)
# Enforce modern Qt code
add_definitions(-DQT_DEPRECATED_WARNINGS
-DQT_USE_QSTRINGBUILDER
-DQT_NO_CAST_TO_ASCII
-DQT_NO_CAST_FROM_ASCII
-DQT_NO_CAST_FROM_BYTEARRAY
-DQT_NO_URL_CAST_FROM_STRING
-DQT_STRICT_ITERATORS
-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT
-DQT_DEPRECATED_WARNINGS_SINCE=0x060000
-DQT_DISABLE_DEPRECATED_BEFORE=0x050E00
# -DQT_NO_FOREACH
# -DQT_NO_KEYWORDS
)
add_library(photolayoutseditorcore STATIC ${photolayoutseditorcore_SRCS})
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(photolayoutseditorcore PRIVATE
-Waddress
-Wall
-Werror
-Wextra
-Wshadow
-Winit-self
-Wfloat-conversion
-Wnull-dereference
-Wpedantic
-Woverloaded-virtual
-Wunused-value
-Wzero-as-null-pointer-constant
-Wno-conversion
-Wno-deprecated-copy
-Wno-int-in-bool-context
-fPIC
)
else()
target_compile_options(photolayoutseditorcore PRIVATE -fPIC)
endif()
# =======================================================
# Stand-alone version of PhotoLayoutsEditor
add_executable(photolayoutseditor
${CMAKE_CURRENT_SOURCE_DIR}/main/main.cpp
)
target_link_libraries(photolayoutseditor
photolayoutseditorcore
Digikam::digikamcore
Qt5::Gui
Qt5::Xml
Qt5::Svg
Qt5::PrintSupport
${CMAKE_THREAD_LIBS_INIT}
)
install(TARGETS photolayoutseditor RUNTIME DESTINATION bin)
if (ENABLE_DPLUGIN)
add_subdirectory(dplugin)
endif()
MACRO_ADD_UNINSTALL_TARGET()