-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathCMakeLists.txt
221 lines (214 loc) · 6.16 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
cmake_minimum_required(VERSION 3.17.0 FATAL_ERROR)
# meta data
project(tagparser)
set(META_PROJECT_NAME ${PROJECT_NAME})
set(META_PROJECT_VARNAME TAG_PARSER)
set(META_APP_NAME "Tag Parser")
set(META_APP_AUTHOR "Martchus")
set(META_APP_URL "https://github.com/${META_APP_AUTHOR}/${META_PROJECT_NAME}")
set(META_APP_DESCRIPTION "C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags")
set(META_VERSION_MAJOR 12)
set(META_VERSION_MINOR 4)
set(META_VERSION_PATCH 0)
set(META_REQUIRED_CPP_UNIT_VERSION 1.14.0)
set(META_ADD_DEFAULT_CPP_UNIT_TEST_APPLICATION ON)
# add project files
set(HEADER_FILES
aac/aaccodebook.h
aac/aacframe.h
abstractattachment.h
abstractchapter.h
abstractcontainer.h
abstracttrack.h
adts/adtsframe.h
adts/adtsstream.h
aspectratio.h
avc/avcconfiguration.h
avc/avcinfo.h
avi/bitmapinfoheader.h
backuphelper.h
basicfileinfo.h
caseinsensitivecomparer.h
diagnostics.h
exceptions.h
fieldbasedtag.h
flac/flacmetadata.h
flac/flacstream.h
flac/flactooggmappingheader.h
genericcontainer.h
genericfileelement.h
generictagfield.h
id3/id3genres.h
id3/id3v1tag.h
id3/id3v2frame.h
id3/id3v2frameids.h
id3/id3v2tag.h
ivf/ivfframe.h
ivf/ivfstream.h
localehelper.h
localeawarestring.h
margin.h
matroska/ebmlelement.h
matroska/ebmlid.h
matroska/matroskaattachment.h
matroska/matroskachapter.h
matroska/matroskacontainer.h
matroska/matroskacues.h
matroska/matroskaeditionentry.h
matroska/matroskaid.h
matroska/matroskaseekinfo.h
matroska/matroskatag.h
matroska/matroskatagfield.h
matroska/matroskatagid.h
matroska/matroskatrack.h
mediafileinfo.h
mediaformat.h
mp4/mp4atom.h
mp4/mp4container.h
mp4/mp4ids.h
mp4/mp4tag.h
mp4/mp4tagfield.h
mp4/mp4track.h
mp4/mpeg4descriptor.h
mpegaudio/mpegaudioframe.h
mpegaudio/mpegaudioframestream.h
ogg/oggcontainer.h
ogg/oggiterator.h
ogg/oggpage.h
ogg/oggstream.h
opus/opusidentificationheader.h
positioninset.h
progressfeedback.h
settings.h
signature.h
size.h
tag.h
tagtarget.h
tagtype.h
tagvalue.h
vorbis/vorbiscomment.h
vorbis/vorbiscommentfield.h
vorbis/vorbiscommentids.h
vorbis/vorbisidentificationheader.h
vorbis/vorbispackagetypes.h
wav/waveaudiostream.h)
set(SRC_FILES
aac/aaccodebook.cpp
aac/aacframe.cpp
abstractattachment.cpp
abstractchapter.cpp
abstractcontainer.cpp
abstracttrack.cpp
adts/adtsframe.cpp
adts/adtsstream.cpp
aspectratio.cpp
av1/av1configuration.h
av1/av1configuration.cpp
avc/avcconfiguration.cpp
avc/avcinfo.cpp
avi/bitmapinfoheader.cpp
backuphelper.cpp
basicfileinfo.cpp
diagnostics.cpp
exceptions.cpp
flac/flacmetadata.cpp
flac/flacstream.cpp
flac/flactooggmappingheader.cpp
id3/id3genres.cpp
id3/id3v1tag.cpp
id3/id3v2frame.cpp
id3/id3v2frameids.cpp
id3/id3v2tag.cpp
ivf/ivfframe.cpp
ivf/ivfstream.cpp
localehelper.cpp
localeawarestring.cpp
matroska/ebmlelement.cpp
matroska/matroskaattachment.cpp
matroska/matroskachapter.cpp
matroska/matroskacontainer.cpp
matroska/matroskacues.cpp
matroska/matroskaeditionentry.cpp
matroska/matroskaid.cpp
matroska/matroskaseekinfo.cpp
matroska/matroskatag.cpp
matroska/matroskatagfield.cpp
matroska/matroskatagid.cpp
matroska/matroskatrack.cpp
mediafileinfo.cpp
mediaformat.cpp
mp4/mp4atom.cpp
mp4/mp4container.cpp
mp4/mp4ids.cpp
mp4/mp4tag.cpp
mp4/mp4tagfield.cpp
mp4/mp4track.cpp
mp4/mpeg4descriptor.cpp
mpegaudio/mpegaudioframe.cpp
mpegaudio/mpegaudioframestream.cpp
ogg/oggcontainer.cpp
ogg/oggiterator.cpp
ogg/oggpage.cpp
ogg/oggstream.cpp
opus/opusidentificationheader.cpp
progressfeedback.cpp
signature.cpp
size.cpp
tag.cpp
tagtarget.cpp
tagvalue.cpp
vorbis/vorbiscomment.cpp
vorbis/vorbiscommentfield.cpp
vorbis/vorbisidentificationheader.cpp
wav/waveaudiostream.cpp)
set(TEST_HEADER_FILES tests/helper.h tests/overall.h)
set(TEST_SRC_FILES
tests/helper.cpp
tests/mediafileinfo.cpp
tests/overallflac.cpp
tests/overallgeneral.cpp
tests/overallmkv.cpp
tests/overallmp3.cpp
tests/overallmp4.cpp
tests/overallogg.cpp
tests/tagvalue.cpp
tests/testfilecheck.cpp
tests/utils.cpp
doc/example.cpp)
set(DOC_FILES README.md doc/adding-new-fields.md)
set(LANGUAGE_HEADER_ISO_639_2 "${CMAKE_CURRENT_BINARY_DIR}/resources/iso_language_codes.h")
set(RES_FILES "${LANGUAGE_HEADER_ISO_639_2}")
# 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.21.0 REQUIRED)
use_cpp_utilities(VISIBILITY PUBLIC)
list(APPEND META_PRIVATE_COMPILE_DEFINITIONS CHRONO_UTILITIES_TIMESPAN_INTEGER_SCALE_OVERLOADS)
# link against a possibly required extra library for std::filesystem
use_standard_filesystem()
# find 3rd party libraries
include(3rdParty)
# zlib
use_zlib()
use_crypto(LIBRARIES_VARIABLE "TEST_LIBRARIES" PACKAGES_VARIABLE "TEST_PACKAGES" OPTIONAL)
if (NOT "OpenSSL::Crypto" IN_LIST "TEST_LIBRARIES")
list(REMOVE_ITEM TEST_SRC_FILES tests/testfilecheck.cpp)
message(WARNING "Unable to check testfile integrity because OpenSSL is not available.")
endif ()
# include modules to apply configuration
include(BasicConfig)
include(WindowsResources)
include(LibraryTarget)
include(TestTarget)
include(Doxygen)
include(ConfigHeader)
# add rules to generate code for dealing with language codes
set(LANGUAGE_FILE_ISO_639_2
""
CACHE STRING "path to JSON document from https://salsa.debian.org/iso-codes-team/iso-codes for ISO-639-2")
add_custom_command(
OUTPUT "${LANGUAGE_HEADER_ISO_639_2}"
COMMENT "Generating code for ISO-639-2 language codes"
COMMAND "${CMAKE_COMMAND}" "-DLANGUAGE_FILE=${LANGUAGE_FILE_ISO_639_2}" "-DOUTPUT_PATH=${LANGUAGE_HEADER_ISO_639_2}" -P
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/scripts/generate_iso_language_codes.cmake")