2019-03-13 19:06:42 +01:00
|
|
|
cmake_minimum_required(VERSION 3.3.0 FATAL_ERROR)
|
2015-12-05 22:53:30 +01:00
|
|
|
|
2019-07-20 18:08:53 +02:00
|
|
|
# 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")
|
2020-12-05 20:48:57 +01:00
|
|
|
set(META_VERSION_MAJOR 10)
|
|
|
|
set(META_VERSION_MINOR 0)
|
2020-11-25 01:39:57 +01:00
|
|
|
set(META_VERSION_PATCH 0)
|
2019-07-20 18:08:53 +02:00
|
|
|
set(META_REQUIRED_CPP_UNIT_VERSION 1.14.0)
|
|
|
|
set(META_ADD_DEFAULT_CPP_UNIT_TEST_APPLICATION ON)
|
|
|
|
|
2015-12-08 08:38:26 +01:00
|
|
|
# add project files
|
|
|
|
set(HEADER_FILES
|
2018-03-06 23:17:35 +01:00
|
|
|
aac/aaccodebook.h
|
|
|
|
aac/aacframe.h
|
2015-12-08 08:38:26 +01:00
|
|
|
abstractattachment.h
|
|
|
|
abstractchapter.h
|
|
|
|
abstractcontainer.h
|
|
|
|
abstracttrack.h
|
|
|
|
adts/adtsframe.h
|
|
|
|
adts/adtsstream.h
|
2016-02-17 20:19:05 +01:00
|
|
|
aspectratio.h
|
|
|
|
avc/avcconfiguration.h
|
|
|
|
avc/avcinfo.h
|
2015-12-08 08:38:26 +01:00
|
|
|
avi/bitmapinfoheader.h
|
|
|
|
backuphelper.h
|
|
|
|
basicfileinfo.h
|
|
|
|
caseinsensitivecomparer.h
|
2018-03-07 01:14:28 +01:00
|
|
|
diagnostics.h
|
|
|
|
exceptions.h
|
|
|
|
fieldbasedtag.h
|
2016-05-14 00:24:01 +02:00
|
|
|
flac/flacmetadata.h
|
2016-05-16 20:56:53 +02:00
|
|
|
flac/flacstream.h
|
2018-03-07 01:14:28 +01:00
|
|
|
flac/flactooggmappingheader.h
|
2015-12-08 08:38:26 +01:00
|
|
|
genericcontainer.h
|
|
|
|
genericfileelement.h
|
|
|
|
generictagfield.h
|
|
|
|
id3/id3genres.h
|
|
|
|
id3/id3v1tag.h
|
|
|
|
id3/id3v2frame.h
|
|
|
|
id3/id3v2frameids.h
|
|
|
|
id3/id3v2tag.h
|
2018-07-28 14:56:00 +02:00
|
|
|
ivf/ivfframe.h
|
|
|
|
ivf/ivfstream.h
|
2020-12-13 18:37:15 +01:00
|
|
|
localehelper.h
|
2015-12-08 08:38:26 +01:00
|
|
|
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
|
2018-03-07 01:14:28 +01:00
|
|
|
matroska/matroskaid.h
|
2015-12-08 08:38:26 +01:00
|
|
|
matroska/matroskaseekinfo.h
|
|
|
|
matroska/matroskatag.h
|
|
|
|
matroska/matroskatagfield.h
|
|
|
|
matroska/matroskatagid.h
|
|
|
|
matroska/matroskatrack.h
|
|
|
|
mediafileinfo.h
|
|
|
|
mediaformat.h
|
2018-03-07 01:14:28 +01:00
|
|
|
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
|
2018-03-05 17:49:29 +01:00
|
|
|
progressfeedback.h
|
2018-03-11 18:57:22 +01:00
|
|
|
settings.h
|
2018-03-07 01:14:28 +01:00
|
|
|
signature.h
|
|
|
|
size.h
|
|
|
|
tag.h
|
|
|
|
tagtarget.h
|
|
|
|
tagvalue.h
|
|
|
|
vorbis/vorbiscomment.h
|
|
|
|
vorbis/vorbiscommentfield.h
|
|
|
|
vorbis/vorbiscommentids.h
|
|
|
|
vorbis/vorbisidentificationheader.h
|
|
|
|
vorbis/vorbispackagetypes.h
|
2019-02-06 18:04:33 +01:00
|
|
|
wav/waveaudiostream.h)
|
2015-12-08 08:38:26 +01:00
|
|
|
set(SRC_FILES
|
2018-03-06 23:17:35 +01:00
|
|
|
aac/aaccodebook.cpp
|
|
|
|
aac/aacframe.cpp
|
2015-12-08 08:38:26 +01:00
|
|
|
abstractattachment.cpp
|
|
|
|
abstractchapter.cpp
|
|
|
|
abstractcontainer.cpp
|
|
|
|
abstracttrack.cpp
|
|
|
|
adts/adtsframe.cpp
|
|
|
|
adts/adtsstream.cpp
|
2016-02-17 20:19:05 +01:00
|
|
|
aspectratio.cpp
|
2018-08-23 23:18:57 +02:00
|
|
|
av1/av1configuration.h
|
|
|
|
av1/av1configuration.cpp
|
2016-02-17 20:19:05 +01:00
|
|
|
avc/avcconfiguration.cpp
|
|
|
|
avc/avcinfo.cpp
|
2015-12-08 08:38:26 +01:00
|
|
|
avi/bitmapinfoheader.cpp
|
|
|
|
backuphelper.cpp
|
|
|
|
basicfileinfo.cpp
|
2018-03-07 01:14:28 +01:00
|
|
|
diagnostics.cpp
|
2015-12-08 08:38:26 +01:00
|
|
|
exceptions.cpp
|
2016-05-14 00:24:01 +02:00
|
|
|
flac/flacmetadata.cpp
|
2016-05-16 20:56:53 +02:00
|
|
|
flac/flacstream.cpp
|
2018-03-07 01:14:28 +01:00
|
|
|
flac/flactooggmappingheader.cpp
|
2015-12-08 08:38:26 +01:00
|
|
|
id3/id3genres.cpp
|
|
|
|
id3/id3v1tag.cpp
|
|
|
|
id3/id3v2frame.cpp
|
|
|
|
id3/id3v2frameids.cpp
|
|
|
|
id3/id3v2tag.cpp
|
2018-07-28 14:56:00 +02:00
|
|
|
ivf/ivfframe.cpp
|
|
|
|
ivf/ivfstream.cpp
|
2020-12-13 18:37:15 +01:00
|
|
|
localehelper.cpp
|
2015-12-08 08:38:26 +01:00
|
|
|
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
|
2018-03-07 01:14:28 +01:00
|
|
|
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
|
2018-03-05 17:49:29 +01:00
|
|
|
progressfeedback.cpp
|
2018-03-07 01:14:28 +01:00
|
|
|
signature.cpp
|
|
|
|
size.cpp
|
|
|
|
tag.cpp
|
|
|
|
tagtarget.cpp
|
|
|
|
tagvalue.cpp
|
|
|
|
vorbis/vorbiscomment.cpp
|
|
|
|
vorbis/vorbiscommentfield.cpp
|
|
|
|
vorbis/vorbisidentificationheader.cpp
|
2019-02-06 18:04:33 +01:00
|
|
|
wav/waveaudiostream.cpp)
|
|
|
|
set(TEST_HEADER_FILES tests/helper.h tests/overall.h)
|
2016-02-17 20:19:05 +01:00
|
|
|
set(TEST_SRC_FILES
|
2017-05-24 19:33:11 +02:00
|
|
|
tests/helper.cpp
|
2018-03-07 01:14:28 +01:00
|
|
|
tests/mediafileinfo.cpp
|
|
|
|
tests/overallflac.cpp
|
2017-05-20 21:15:48 +02:00
|
|
|
tests/overallgeneral.cpp
|
|
|
|
tests/overallmkv.cpp
|
|
|
|
tests/overallmp3.cpp
|
2018-03-07 01:14:28 +01:00
|
|
|
tests/overallmp4.cpp
|
2017-05-20 21:15:48 +02:00
|
|
|
tests/overallogg.cpp
|
2017-06-03 20:38:46 +02:00
|
|
|
tests/tagvalue.cpp
|
2018-03-07 01:14:28 +01:00
|
|
|
tests/testfilecheck.cpp
|
2019-02-06 18:04:33 +01:00
|
|
|
tests/utils.cpp)
|
|
|
|
set(DOC_FILES README.md doc/adding-new-fields.md)
|
2021-01-20 21:59:34 +01:00
|
|
|
set(LANGUAGE_HEADER_ISO_639_2 "${CMAKE_CURRENT_BINARY_DIR}/resources/iso_language_codes.h")
|
|
|
|
set(RES_FILES "${LANGUAGE_HEADER_ISO_639_2}")
|
2016-06-10 23:08:01 +02:00
|
|
|
|
2016-04-16 00:50:46 +02:00
|
|
|
# find c++utilities
|
2019-06-01 12:32:17 +02:00
|
|
|
set(CONFIGURATION_PACKAGE_SUFFIX
|
|
|
|
""
|
2019-05-04 21:03:09 +02:00
|
|
|
CACHE STRING "sets the suffix for find_package() calls to packages configured via c++utilities")
|
2020-12-14 20:27:54 +01:00
|
|
|
find_package(c++utilities${CONFIGURATION_PACKAGE_SUFFIX} 5.10.0 REQUIRED)
|
2019-03-13 19:06:42 +01:00
|
|
|
use_cpp_utilities(VISIBILITY PUBLIC)
|
2015-12-08 08:38:26 +01:00
|
|
|
|
2016-07-22 01:36:54 +02:00
|
|
|
# find 3rd party libraries
|
|
|
|
include(3rdParty)
|
2016-08-19 16:18:27 +02:00
|
|
|
# zlib
|
2019-03-13 19:06:42 +01:00
|
|
|
use_zlib()
|
|
|
|
use_crypto(LIBRARIES_VARIABLE "TEST_LIBRARIES" OPTIONAL)
|
|
|
|
if (NOT "OpenSSL::Crypto" IN_LIST "TEST_LIBRARIES")
|
2017-04-15 23:21:16 +02:00
|
|
|
list(REMOVE_ITEM TEST_SRC_FILES tests/testfilecheck.cpp)
|
|
|
|
message(WARNING "Unable to check testfile integrity because OpenSSL is not available.")
|
2019-02-06 18:04:33 +01:00
|
|
|
endif ()
|
2015-12-05 22:53:30 +01:00
|
|
|
|
2016-04-16 00:50:46 +02:00
|
|
|
# include modules to apply configuration
|
|
|
|
include(BasicConfig)
|
|
|
|
include(WindowsResources)
|
|
|
|
include(LibraryTarget)
|
|
|
|
include(TestTarget)
|
2016-06-10 23:08:01 +02:00
|
|
|
include(Doxygen)
|
2016-07-27 21:39:21 +02:00
|
|
|
include(ConfigHeader)
|
2019-08-17 20:56:09 +02:00
|
|
|
|
2020-12-04 18:06:42 +01:00
|
|
|
# add rules to generate code for dealing with language codes
|
2021-01-20 21:59:34 +01:00
|
|
|
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")
|
2020-12-04 18:06:42 +01:00
|
|
|
add_custom_command(
|
2021-01-20 21:59:34 +01:00
|
|
|
OUTPUT "${LANGUAGE_HEADER_ISO_639_2}"
|
2020-12-04 18:06:42 +01:00
|
|
|
COMMENT "Generating code for ISO-639-2 language codes"
|
2021-01-20 21:59:34 +01:00
|
|
|
COMMAND "${CMAKE_COMMAND}" "-DLANGUAGE_FILE=${LANGUAGE_FILE_ISO_639_2}" "-DOUTPUT_PATH=${LANGUAGE_HEADER_ISO_639_2}" -P
|
2020-12-04 18:06:42 +01:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/scripts/generate_iso_language_codes.cmake")
|