Warning, /multimedia/k3b/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 cmake_minimum_required(VERSION 3.16)
0002 
0003 # KDE Application Version, managed by release script
0004 set (RELEASE_SERVICE_VERSION_MAJOR "22")
0005 set (RELEASE_SERVICE_VERSION_MINOR "11")
0006 set (RELEASE_SERVICE_VERSION_MICRO "70")
0007 set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
0008 
0009 project(k3b VERSION ${RELEASE_SERVICE_VERSION})
0010 
0011 set (QT_MIN_VERSION "5.14.0")
0012 set (KF5_MIN_VERSION "5.88.0")
0013 set (KDE_COMPILERSETTINGS_LEVEL "5.84")
0014 
0015 find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
0016 set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" "${ECM_MODULE_PATH}")
0017 
0018 ##################  K3b version  ################################
0019 set(K3B_VERSION_STRING ${RELEASE_SERVICE_VERSION})
0020 
0021 # increase on BC breakage
0022 set(K3B_LIB_VERSION_MAJOR 8)
0023 
0024 # increase after adding functionality
0025 set(K3B_LIB_VERSION_MINOR 0)
0026 set(K3B_LIB_VERSION_RELEASE 0)
0027 
0028 
0029 ##################  K3b options #################################
0030 option(K3B_DEBUG "K3b additional debugging support" OFF)
0031 if(K3B_DEBUG)
0032     add_definitions(-g)
0033 endif()
0034 option(K3B_ENABLE_MUSICBRAINZ "Support for querying metadata about audio tracks from Musicbrainz." ON)
0035 option(K3B_ENABLE_DVD_RIPPING "Support for ripping Video DVDs with optional decryption." ON)
0036 option(K3B_ENABLE_TAGLIB "Support for reading audio file metadata using Taglib." ON)
0037 option(K3B_BUILD_API_DOCS "Build the API documentation for the K3b libs." OFF)
0038 
0039 # plugin options
0040 option(K3B_BUILD_OGGVORBIS_DECODER_PLUGIN "Build Ogg-Vorbis decoder plugin" ON)
0041 option(K3B_BUILD_OGGVORBIS_ENCODER_PLUGIN "Build Ogg-Vorbis encoder plugin" ON)
0042 option(K3B_BUILD_MAD_DECODER_PLUGIN "Build MAD mp3 decoder plugin" ON)
0043 option(K3B_BUILD_MUSE_DECODER_PLUGIN "Build Musepack decoder plugin" ON)
0044 option(K3B_BUILD_FLAC_DECODER_PLUGIN "Build Flac decoder plugin" ON)
0045 option(K3B_BUILD_SNDFILE_DECODER_PLUGIN "Build libsndfile decoder plugin" ON)
0046 option(K3B_BUILD_LAME_ENCODER_PLUGIN "Build Lame encoder plugin" ON)
0047 option(K3B_BUILD_SOX_ENCODER_PLUGIN "Build Sox encoder plugin" ON)
0048 option(K3B_BUILD_EXTERNAL_ENCODER_PLUGIN "Build external app encoder plugin" ON)
0049 option(K3B_BUILD_WAVE_DECODER_PLUGIN "Build Wave decoder plugin" ON)
0050 
0051 ##################  K3b requirements #################################
0052 include(KDEInstallDirs)
0053 include(KDECompilerSettings NO_POLICY_SCOPE)
0054 include(KDECMakeSettings)
0055 include(FeatureSummary)
0056 include(GenerateExportHeader)
0057 include(ECMInstallIcons)
0058 include(ECMEnableSanitizers)
0059 include(ECMSetupQtPluginMacroNames)
0060 
0061 find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core DBus Gui)
0062 find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Archive Auth Config CoreAddons DocTools FileMetaData I18n IconThemes JobWidgets
0063                                      KCMUtils KIO Notifications NewStuff NotifyConfig Service Solid WidgetsAddons XmlGui)
0064 
0065 find_package(Qt5WebKitWidgets)
0066 set_package_properties(Qt5WebKitWidgets PROPERTIES
0067     DESCRIPTION "Qt5WebKitWidgets is used for prettier k3bdiskinfoview."
0068     TYPE OPTIONAL)
0069 if(Qt5WebKitWidgets_FOUND)
0070     add_definitions(-DHAVE_QT5WEBKITWIDGETS)
0071 endif()
0072 
0073 add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
0074 
0075 option(WITH_NEW_SOLID_JOB "WIP: base Job class" Off)
0076 add_feature_info(Solid::Job WITH_NEW_SOLID_JOB "WIP: Base class for Solid Asynchronous apis")
0077 if(WITH_NEW_SOLID_JOB)
0078     add_definitions(-DWITH_NEW_SOLID_JOB)
0079 endif()
0080 
0081 find_package(Iconv)
0082 set(HAVE_ICONV "${ICONV_FOUND}")
0083 
0084 find_package(Samplerate)
0085 set_package_properties(Samplerate PROPERTIES
0086     DESCRIPTION "Audio sampling rate conversion."
0087     URL "http://www.mega-nerd.com/SRC"
0088     TYPE REQUIRED)
0089 
0090 find_package(KF5Cddb 5.1 REQUIRED)
0091 set_package_properties(KF5Cddb PROPERTIES
0092     DESCRIPTION "KF5 branch for CDDB library"
0093     URL "https://commits.kde.org/libkcddb"
0094     TYPE REQUIRED
0095     PURPOSE "libkcddb is used to retrieve audio CD meta data from the internet.")
0096 
0097 if(K3B_ENABLE_DVD_RIPPING)
0098     find_package(DvdRead)
0099     set_package_properties(DvdRead PROPERTIES
0100         DESCRIPTION "Libdvdread provides a simple foundation for reading DVD video disks."
0101         URL "https://www.videolan.org/developers/libdvdnav.html"
0102         TYPE OPTIONAL)
0103 
0104     set(ENABLE_DVD_RIPPING "${DVDREAD_FOUND}")
0105 endif()
0106 
0107 if(K3B_ENABLE_TAGLIB)
0108     find_package(Taglib)
0109     set_package_properties(Taglib PROPERTIES
0110         DESCRIPTION "Read and write tags in audio files"
0111         URL "https://taglib.org/"
0112         TYPE OPTIONAL)
0113 
0114     set(ENABLE_TAGLIB "${TAGLIB_FOUND}")
0115 endif()
0116 
0117 if(K3B_ENABLE_MUSICBRAINZ)
0118     find_package(MusicBrainz)
0119     set_package_properties(MusicBrainz PROPERTIES
0120         DESCRIPTION "Provide information about the CD, about the artist or about related information"
0121         URL "https://musicbrainz.org/"
0122         TYPE OPTIONAL)
0123 
0124     set(ENABLE_MUSICBRAINZ "${MUSICBRAINZ_FOUND}")
0125 endif()
0126 
0127 if(K3B_BUILD_FLAC_DECODER_PLUGIN)
0128     find_package(Flac)
0129     set_package_properties(Flac PROPERTIES
0130         PURPOSE "Needed for the Flac audio decoder plugin."
0131         URL "https://xiph.org/flac/"
0132         TYPE OPTIONAL)
0133 
0134     find_package(Flac++)
0135     set_package_properties(Flac++ PROPERTIES
0136         PURPOSE "Needed for the Flac audio decoder plugin."
0137         URL "https://xiph.org/flac/"
0138         TYPE OPTIONAL)
0139 
0140     if(FLAC_FOUND AND FLAC++_FOUND)
0141         set(BUILD_FLAC_DECODER_PLUGIN 1)
0142     endif()
0143 endif()
0144 
0145 if(K3B_BUILD_MAD_DECODER_PLUGIN)
0146     find_package(Mad)
0147     set_package_properties(Mad PROPERTIES
0148         PURPOSE "Needed for the mp3 audio decoder plugin."
0149         URL "https://www.underbit.com/products/mad"
0150         TYPE OPTIONAL)
0151 
0152     set(BUILD_MAD_DECODER_PLUGIN "${MAD_FOUND}")
0153 endif()
0154 
0155 if(K3B_BUILD_MUSE_DECODER_PLUGIN)
0156     find_package(Muse)
0157     set_package_properties(Muse PROPERTIES
0158         PURPOSE "Needed for the Musepack audio decoder plugin"
0159         URL "https://www.musepack.net/"
0160         TYPE OPTIONAL)
0161 
0162     set(BUILD_MUSE_DECODER_PLUGIN "${Muse_FOUND}")
0163 endif()
0164 
0165 if(K3B_BUILD_SNDFILE_DECODER_PLUGIN)
0166     find_package(Sndfile)
0167     set_package_properties(Sndfile PROPERTIES
0168         PURPOSE "Needed for the libsndfile audio decoder plugin."
0169         URL "http://www.mega-nerd.com/libsndfile"
0170         TYPE OPTIONAL)
0171 
0172     set(BUILD_SNDFILE_DECODER_PLUGIN "${SNDFILE_FOUND}")
0173 endif()
0174 
0175 if(K3B_BUILD_LAME_ENCODER_PLUGIN)
0176     find_package(Lame)
0177     set_package_properties(Lame PROPERTIES
0178         DESCRIPTION "Lame mp3 encoder"
0179         PURPOSE "Needed for the lame mpf encoder encoder plugin."
0180         URL "https://lame.sourceforge.io/"
0181         TYPE OPTIONAL)
0182 
0183     set(BUILD_LAME_ENCODER_PLUGIN "${LAME_FOUND}")
0184 endif()
0185 
0186 if(K3B_BUILD_OGGVORBIS_DECODER_PLUGIN OR K3B_BUILD_OGGVORBIS_ENCODER_PLUGIN)
0187     find_package(OggVorbis)
0188     set_package_properties(OggVorbis PROPERTIES
0189         DESCRIPTION "Ogg Vorbis"
0190         PURPOSE "Needed for the K3b Ogg Vorbis decoder and encoder plugins."
0191         URL "https://xiph.org/vorbis/"
0192         TYPE OPTIONAL)
0193 
0194     set(BUILD_OGGVORBIS_DECODER_PLUGIN "${OGGVORBIS_FOUND}")
0195     set(BUILD_OGGVORBIS_ENCODER_PLUGIN "${OGGVORBIS_FOUND}")
0196 endif()
0197 
0198 ###################  K3b build settings #################################
0199 include(ConfigureChecks)
0200 
0201 set(BUILD_WAVE_DECODER_PLUGIN "${K3B_BUILD_WAVE_DECODER_PLUGIN}")
0202 set(BUILD_SOX_ENCODER_PLUGIN "${K3B_BUILD_SOX_ENCODER_PLUGIN}")
0203 set(BUILD_EXTERNAL_ENCODER_PLUGIN "${K3B_BUILD_EXTERNAL_ENCODER_PLUGIN}")
0204 
0205 set(ENABLE_HAL_SUPPORT "${K3B_ENABLE_HAL_SUPPORT}")
0206 set(ENABLE_AUDIO_PLAYER "${QT_QTMULTIMEDIA_FOUND}")
0207 
0208 if(IS_ABSOLUTE ${DATA_INSTALL_DIR})
0209   set(K3B_DATA_INSTALL_DIR ${DATA_INSTALL_DIR}/k3b)
0210 else()
0211   set(K3B_DATA_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${DATA_INSTALL_DIR}/k3b)
0212 endif()
0213 
0214 configure_file(config-k3b.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-k3b.h)
0215 include_directories(${CMAKE_BINARY_DIR})
0216 
0217 ecm_setup_qtplugin_macro_names(
0218     JSON_NONE
0219         K3B_EXPORT_PLUGIN
0220         K3B_EXPORT_PLUGIN_CONFIG_WIDGET
0221 )
0222 
0223 ##################  K3b apidox ################################
0224 if(K3B_BUILD_API_DOCS)
0225     find_package(Doxygen)
0226 
0227     if(DOXYGEN_EXECUTABLE)
0228         configure_file(${CMAKE_SOURCE_DIR}/Doxyfile.cmake ${CMAKE_BINARY_DIR}/Doxyfile)
0229 
0230         if(EXISTS ${QT_DOC_DIR}/html)
0231             set(QTDOCS "${QT_DOC_DIR}/html")
0232         else()
0233             set(QTDOCS "https://doc.qt.io/qt-5/")
0234         endif()
0235 
0236         add_custom_target(apidox
0237             COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
0238             COMMAND docs/html/installdox -l qt5.tag@${QTDOCS} docs/html/*.html)
0239     endif()
0240 endif(K3B_BUILD_API_DOCS)
0241 
0242 ##################  K3b build environment ################################
0243 add_subdirectory( libk3bdevice )
0244 add_subdirectory( libk3b )
0245 add_subdirectory( src )
0246 add_subdirectory( kioslaves )
0247 add_subdirectory( plugins )
0248 add_subdirectory( doc )
0249 if(BUILD_TESTING)
0250     find_package(Qt5Test REQUIRED)
0251     find_package(LibFuzzer)
0252     set_package_properties(LibFuzzer PROPERTIES
0253         PURPOSE "libFuzzer – a library for coverage-guided fuzz testing."
0254         URL "https://llvm.org/docs/LibFuzzer.html"
0255         TYPE OPTIONAL)
0256     add_subdirectory(tests)
0257 endif()
0258 
0259 ki18n_install(po)
0260 kdoctools_install(po)
0261 
0262 ###################  K3b config summary ################################
0263 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)