-
Notifications
You must be signed in to change notification settings - Fork 56
/
CMakeLists.txt
280 lines (257 loc) · 7.93 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
cmake_minimum_required(VERSION 3.17.0 FATAL_ERROR)
# meta data
project(tageditor)
set(META_PROJECT_NAME ${PROJECT_NAME})
set(META_PROJECT_TYPE application)
set(META_APP_NAME "Tag Editor")
set(META_APP_CATEGORIES "AudioVideo;Database;")
set(META_APP_AUTHOR "Martchus")
set(META_APP_URL "https://github.com/${META_APP_AUTHOR}/${META_PROJECT_NAME}")
set(META_APP_DESCRIPTION
"A tageditor with Qt GUI and command line interface. Supports MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska")
set(META_GUI_OPTIONAL true)
set(META_JS_SRC_DIR renamingutility)
set(META_VERSION_MAJOR 3)
set(META_VERSION_MINOR 9)
set(META_VERSION_PATCH 4)
set(META_RELEASE_DATE "2024-12-03")
set(META_ADD_DEFAULT_CPP_UNIT_TEST_APPLICATION ON)
# add project files
set(HEADER_FILES cli/attachmentinfo.h cli/fieldmapping.h cli/helper.h cli/mainfeatures.h application/knownfieldmodel.h)
set(SRC_FILES application/main.cpp cli/attachmentinfo.cpp cli/fieldmapping.cpp cli/helper.cpp cli/mainfeatures.cpp
application/knownfieldmodel.cpp)
set(GUI_HEADER_FILES application/targetlevelmodel.h application/settings.h gui/fileinfomodel.h misc/htmlinfo.h
misc/utility.h)
set(GUI_SRC_FILES application/targetlevelmodel.cpp application/settings.cpp gui/fileinfomodel.cpp misc/htmlinfo.cpp
misc/utility.cpp)
set(WIDGETS_HEADER_FILES
gui/entertargetdialog.h
gui/javascripthighlighter.h
gui/attachmentsedit.h
gui/attachmentsmodel.h
gui/codeedit.h
gui/mainwindow.h
gui/minimumemptyspinbox.h
gui/notificationlabel.h
gui/notificationmodel.h
gui/pathlineedit.h
gui/picturepreviewselection.h
gui/filefilterproxymodel.h
gui/initiate.h
gui/previousvaluehandling.h
gui/renamefilesdialog.h
gui/settingsdialog.h
gui/tagedit.h
gui/tagfieldedit.h
gui/tageditorwidget.h
dbquery/dbquery.h
dbquery/musicbrainz.h
dbquery/makeitpersonal.h
dbquery/lyricswikia.h
dbquery/tekstowo.h
gui/dbquerywidget.h
misc/networkaccessmanager.h
renamingutility/filesystemitem.h
renamingutility/filesystemitemmodel.h
renamingutility/filteredfilesystemitemmodel.h
renamingutility/renamingengine.h
renamingutility/tageditorobject.h)
set(WIDGETS_SRC_FILES
gui/attachmentsedit.cpp
gui/attachmentsmodel.cpp
gui/codeedit.cpp
gui/entertargetdialog.cpp
gui/mainwindow.cpp
gui/minimumemptyspinbox.cpp
gui/notificationlabel.cpp
gui/notificationmodel.cpp
gui/pathlineedit.cpp
gui/picturepreviewselection.cpp
gui/filefilterproxymodel.cpp
gui/initiate.cpp
gui/javascripthighlighter.cpp
gui/renamefilesdialog.cpp
gui/settingsdialog.cpp
gui/tagedit.cpp
gui/tagfieldedit.cpp
gui/tageditorwidget.cpp
dbquery/dbquery.cpp
dbquery/musicbrainz.cpp
dbquery/makeitpersonal.cpp
dbquery/lyricswikia.cpp
dbquery/tekstowo.cpp
gui/dbquerywidget.cpp
misc/networkaccessmanager.cpp
renamingutility/filesystemitem.cpp
renamingutility/filesystemitemmodel.cpp
renamingutility/filteredfilesystemitemmodel.cpp
renamingutility/renamingengine.cpp
renamingutility/tageditorobject.cpp
resources/icons.qrc
resources/scripts.qrc)
set(WIDGETS_UI_FILES
gui/id3v2optionpage.ui
gui/id3v1optionpage.ui
gui/tagprocessinggeneraloptionpage.ui
gui/tagprocessingtargetsoptionpage.ui
gui/editorgeneraloptionpage.ui
gui/filebrowsergeneraloptionpage.ui
gui/mainwindow.ui
gui/renamefilesdialog.ui
gui/editorautocorrectionoptionpage.ui
gui/picturepreviewselection.ui
gui/editorfieldsoptionpage.ui
gui/editordbqueryoptionpage.ui
gui/infooptionpage.ui
gui/entertargetdialog.ui
gui/attachmentsedit.ui
gui/editortempoptionpage.ui
gui/filelayout.ui
gui/tageditorwidget.ui
gui/dbquerywidget.ui
gui/imageconversiondialog.ui)
set(TEST_HEADER_FILES)
set(TEST_SRC_FILES tests/cli.cpp)
set(EXCLUDED_FILES cli/scriptapi.h cli/scriptapi.cpp)
set(TS_FILES translations/${META_PROJECT_NAME}_de_DE.ts translations/${META_PROJECT_NAME}_en_US.ts)
set(ICON_FILES resources/icons/hicolor/scalable/apps/${META_PROJECT_NAME}.svg)
set(DOC_FILES README.md)
set(REQUIRED_ICONS
window-close
document-open
edit-clear
edit-copy
edit-rename
emblem-error
emblem-warning
emblem-information
emblem-question
object-locked
object-unlocked
preferences-other
view-refresh
view-preview
document-open-recent
tag-add
process-stop
edit-find
media-playback-start
list-add
tag
dialog-ok-apply
help-about
preferences-desktop-locale
edit-undo
document-properties
image-x-generic
unlock
tag-properties
edit-rename
system-run
go-next
expand-menu-hover
autocorrection
lock
qtcreator
collapse-menu-hover
edit-paste
document-save-as
view-list-tree
document-edit
edit-delete
search
system-search
document-revert
dialog-ok
preferences-desktop-icons
dialog-cancel
edit-clear
application-exit
tag-delete
system-file-manager
document-save
view-media-lyrics
image-resize-symbolic
window-new)
# find c++utilities
set(CONFIGURATION_PACKAGE_SUFFIX
""
CACHE STRING "sets the suffix for find_package() calls to packages configured via c++utilities")
find_package(c++utilities${CONFIGURATION_PACKAGE_SUFFIX} 5.23.0 REQUIRED)
use_cpp_utilities()
include(BasicConfig)
# link against a possibly required extra library for std::filesystem
use_standard_filesystem()
# find qtutilities
if (WIDGETS_GUI OR QUICK_GUI)
set(CONFIGURATION_PACKAGE_SUFFIX_QTUTILITIES
"${CONFIGURATION_PACKAGE_SUFFIX}"
CACHE STRING "sets the suffix for qtutilities")
find_package(qtutilities${CONFIGURATION_PACKAGE_SUFFIX_QTUTILITIES} 6.12.0 REQUIRED)
use_qt_utilities()
endif ()
# find tagparser
find_package(tagparser${CONFIGURATION_PACKAGE_SUFFIX} 12.4.0 REQUIRED)
use_tag_parser()
# enable experimental JSON export
option(ENABLE_JSON_EXPORT "enable JSON export" OFF)
if (ENABLE_JSON_EXPORT)
# find reflective-rapidjson
find_package(reflective_rapidjson${CONFIGURATION_PACKAGE_SUFFIX} REQUIRED)
use_reflective_rapidjson()
# add additional source files
list(APPEND HEADER_FILES cli/json.h)
list(APPEND SRC_FILES cli/json.cpp)
# add generator invocation
include(ReflectionGenerator)
add_reflection_generator_invocation(
INPUT_FILES
cli/json.h
GENERATORS
json
OUTPUT_LISTS
HEADER_FILES
CLANG_OPTIONS_FROM_TARGETS
${META_TARGET_NAME})
# add compile definitions
list(APPEND META_PRIVATE_COMPILE_DEFINITIONS ${META_PROJECT_VARNAME_UPPER}_JSON_EXPORT)
endif ()
# add Qt modules which can not be detected automatically
list(APPEND ADDITIONAL_QT_MODULES Concurrent Network)
# configure usage of Qt
if (WIDGETS_GUI OR QUICK_GUI)
include(QtGuiConfig)
include(QtJsProviderConfig)
include(QtWebViewProviderConfig)
include(QtConfig)
endif ()
# configure JavaScript processing for the CLI
if (JS_PROVIDER STREQUAL Qml)
list(APPEND HEADER_FILES cli/scriptapi.h)
list(APPEND SRC_FILES cli/scriptapi.cpp)
list(APPEND SRC_FILES resources/scripts/scriptapi/scriptapi.qrc)
endif ()
# include modules to apply configuration
include(WindowsResources)
include(TestTarget)
include(AppTarget)
include(ShellCompletion)
include(ConfigHeader)
# create desktop file using previously defined meta data
add_desktop_file()
# create custom desktop file for launching the renaming utility separately
add_custom_desktop_file(
FILE_NAME
"${META_ID}-renamingutility"
DESKTOP_FILE_APP_NAME
"Renaming utility (${META_APP_NAME})"
DESKTOP_FILE_GENERIC_NAME
"Renaming utility (${META_APP_NAME})"
DESKTOP_FILE_DESCRIPTION
"Tool to rename files using its tag information"
DESKTOP_FILE_CATEGORIES
"${META_APP_CATEGORIES}"
DESKTOP_FILE_CMD
"${META_TARGET_NAME} qt-gui --renaming-utility"
DESKTOP_FILE_ICON
"${META_PROJECT_NAME}")