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

0001 ## Compiler flags
0002 
0003 add_definitions(-DTRANSLATION_DOMAIN=\"libkcompactdisc\")
0004 
0005 if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_C_COMPILER_ID MATCHES "Clang")
0006     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")   ## ALSA no longer compiles with -std=c90, see https://bugzilla.novell.com/show_bug.cgi?id=817077
0007 endif()
0008 
0009 find_package(ALSA)
0010 set_package_properties(ALSA PROPERTIES
0011                        URL "https://www.alsa-project.org/"
0012                        DESCRIPTION "ALSA provides audio and MIDI functionality"
0013                        TYPE OPTIONAL
0014                        PURPOSE "Play back audio CDs via ALSA")
0015 set(HAVE_ALSA ${ALSA_FOUND})
0016 
0017 set(KCOMPACTDISC_INSTALL_INCLUDEDIR "${KDE_INSTALL_INCLUDEDIR_KF}/KCompactDisc")
0018 set(KCOMPACTDISC_CMAKECONFIG_NAME "KF5CompactDisc")
0019 
0020 # Version Setup
0021 
0022 ecm_setup_version(${KCompactDisc_VERSION}
0023     VARIABLE_PREFIX KCOMPACTDISC
0024     VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/kcompactdisc_version.h
0025     PACKAGE_VERSION_FILE ${CMAKE_CURRENT_BINARY_DIR}/${KCOMPACTDISC_CMAKECONFIG_NAME}ConfigVersion.cmake
0026     SOVERSION 5
0027 )
0028 
0029 configure_file(config-alsa.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-alsa.h)
0030 
0031 add_library(KCompactDisc SHARED)
0032 add_library(KF5::CompactDisc ALIAS KCompactDisc)
0033 
0034 if (APPLE OR WIN32 OR CMAKE_SYSTEM_NAME STREQUAL GNU)
0035     set(USE_WMLIB false)
0036 else()
0037     set(USE_WMLIB true)
0038 endif()
0039 
0040 target_sources(KCompactDisc PRIVATE
0041     kcompactdisc.cpp
0042     kcompactdisc_p.cpp
0043     phonon_interface.cpp
0044 )
0045 
0046 if (USE_WMLIB)
0047     target_sources(KCompactDisc PRIVATE
0048         wmlib_interface.cpp
0049 
0050         wmlib/audio/audio.c
0051         wmlib/audio/audio_arts.c
0052         wmlib/audio/audio_alsa.c
0053         wmlib/audio/audio_sun.c
0054 
0055         wmlib/cdda.c
0056         wmlib/cddb.c
0057         wmlib/cdrom.c
0058         wmlib/wm_helpers.c
0059         wmlib/cdtext.c
0060         wmlib/scsi.c
0061         wmlib/plat_aix.c
0062         wmlib/plat_bsd386.c
0063         wmlib/plat_freebsd.c
0064         wmlib/plat_hpux.c
0065         wmlib/plat_irix.c
0066         wmlib/plat_linux.c
0067         wmlib/plat_svr4.c
0068         wmlib/plat_ultrix.c
0069         wmlib/plat_news.c
0070         wmlib/plat_openbsd.c
0071         wmlib/plat_osf1.c
0072         wmlib/plat_sun.c
0073         wmlib/plat_scor5.c
0074         wmlib/drv_sony.c
0075         wmlib/drv_toshiba.c
0076     )
0077     target_compile_definitions(KCompactDisc PRIVATE -DUSE_WMLIB=1)
0078 endif()
0079 
0080 set_target_properties(KCompactDisc PROPERTIES
0081     VERSION ${KCOMPACTDISC_VERSION}
0082     SOVERSION ${KCOMPACTDISC_SOVERSION}
0083     OUTPUT_NAME  KF5CompactDisc
0084     EXPORT_NAME CompactDisc
0085 )
0086 
0087 target_link_libraries(KCompactDisc
0088     PUBLIC
0089         Qt::Core
0090     PRIVATE
0091         Qt::DBus
0092         KF5::Solid
0093         KF5::I18n
0094         Phonon::phonon4qt${QT_MAJOR_VERSION}
0095 )
0096 
0097 if (HAVE_ALSA)
0098     target_link_libraries(KCompactDisc PRIVATE ALSA::ALSA)
0099 endif()
0100 
0101 if (USE_WMLIB)
0102     find_package(Threads)
0103     target_link_libraries(KCompactDisc PRIVATE ${CMAKE_THREAD_LIBS_INIT})
0104 endif()
0105 
0106 target_include_directories(KCompactDisc
0107     INTERFACE
0108         "$<INSTALL_INTERFACE:${KCOMPACTDISC_INSTALL_INCLUDEDIR}>"
0109 )
0110 
0111 ecm_generate_headers(KCompactDisc_HEADERS
0112     HEADER_NAMES 
0113     KCompactDisc
0114     REQUIRED_HEADERS KCompactDisc_HEADERS
0115 )
0116 generate_export_header(KCompactDisc BASE_NAME KCompactDisc)
0117 
0118 
0119 install(TARGETS KCompactDisc EXPORT KCompactDiscTargets ${KF_INSTALL_TARGETS_DEFAULT_ARGS})
0120 install(FILES
0121     ${CMAKE_CURRENT_BINARY_DIR}/kcompactdisc_export.h
0122     ${KCompactDisc_HEADERS}
0123     DESTINATION ${KCOMPACTDISC_INSTALL_INCLUDEDIR}
0124     COMPONENT Devel
0125 )
0126 install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
0127 
0128 
0129 set(CMAKECONFIG_INSTALL_DIR ${KDE_INSTALL_CMAKEPACKAGEDIR}/${KCOMPACTDISC_CMAKECONFIG_NAME})
0130 
0131 configure_package_config_file(
0132     ${CMAKE_CURRENT_SOURCE_DIR}/${KCOMPACTDISC_CMAKECONFIG_NAME}Config.cmake.in
0133     ${CMAKE_CURRENT_BINARY_DIR}/${KCOMPACTDISC_CMAKECONFIG_NAME}Config.cmake
0134     INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
0135 )
0136 
0137 install(FILES
0138     ${CMAKE_CURRENT_BINARY_DIR}/${KCOMPACTDISC_CMAKECONFIG_NAME}Config.cmake
0139     ${CMAKE_CURRENT_BINARY_DIR}/${KCOMPACTDISC_CMAKECONFIG_NAME}ConfigVersion.cmake
0140     DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0141     COMPONENT Devel
0142 )
0143 
0144 install(EXPORT
0145     KCompactDiscTargets
0146     DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0147     FILE ${KCOMPACTDISC_CMAKECONFIG_NAME}Targets.cmake
0148     NAMESPACE KF5::
0149     COMPONENT Devel
0150 )
0151 
0152 install(FILES
0153     ${CMAKE_CURRENT_BINARY_DIR}/kcompactdisc_version.h
0154     DESTINATION "${KDE_INSTALL_INCLUDEDIR_KF}"
0155     COMPONENT Devel
0156 )
0157 
0158 ecm_generate_pri_file(
0159     BASE_NAME KCompactDisc
0160     LIB_NAME KF5CompactDisc
0161     DEPS "core dbus phonon4qt5 KCoreAddons KI18n Solid"
0162     FILENAME_VAR PRI_FILENAME
0163     INCLUDE_INSTALL_DIR ${KCOMPACTDISC_INSTALL_INCLUDEDIR}
0164 )