Warning, /libraries/upnp-lib-qt/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 # SPDX-FileCopyrightText: 2015 (c) Matthieu Gallien <matthieu_gallien@yahoo.fr> 0002 0003 # SPDX-License-Identifier: BSD-2-Clause 0004 0005 cmake_minimum_required(VERSION 3.8) 0006 0007 set(CMAKE_CXX_STANDARD_REQUIRED ON) 0008 set(CMAKE_CXX_STANDARD 17) 0009 0010 project(UpnpLibQt VERSION 0.1) 0011 0012 set(KF5_VERSION "5.59.0") 0013 0014 include(FeatureSummary) 0015 find_package(ECM ${KF5_VERSION} NO_MODULE) 0016 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules") 0017 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) 0018 0019 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) 0020 0021 include(KDEInstallDirs) 0022 include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) 0023 include(KDECMakeSettings) 0024 include(GenerateExportHeader) 0025 0026 set(REQUIRED_QT_VERSION 6.4.0) 0027 find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core Network Xml) 0028 find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG OPTIONAL_COMPONENTS Qml Quick Widgets Test) 0029 0030 find_package(KDSoap-qt6 1.5.0 CONFIG REQUIRED) 0031 0032 include(ECMSetupVersion) 0033 include(ECMGenerateHeaders) 0034 include(ECMQtDeclareLoggingCategory) 0035 include(ECMAddQch) 0036 0037 option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF) 0038 add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)") 0039 0040 ecm_setup_version(PROJECT 0041 VARIABLE_PREFIX UPNPLIBQT 0042 VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/upnplibqt_version.h" 0043 PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/UpnpLibQtConfigVersion.cmake" 0044 SOVERSION 5) 0045 add_definitions(-DQT_NO_FOREACH) 0046 0047 add_subdirectory(src) 0048 if (BUILD_TESTING) 0049 add_subdirectory(tests) 0050 add_subdirectory(autotests) 0051 endif() 0052 0053 # create a Config.cmake and a ConfigVersion.cmake file and install them 0054 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/UpnpLibQt") 0055 0056 if (BUILD_QCH) 0057 ecm_install_qch_export( 0058 TARGETS UpnpLibQt_QCH 0059 FILE UpnpLibQtQchTargets.cmake 0060 DESTINATION "${CMAKECONFIG_INSTALL_DIR}" 0061 COMPONENT Devel 0062 ) 0063 set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/UpnpLibQtQchTargets.cmake\")") 0064 endif() 0065 0066 include(CMakePackageConfigHelpers) 0067 0068 configure_package_config_file( 0069 "${CMAKE_CURRENT_SOURCE_DIR}/UpnpLibQtConfig.cmake.in" 0070 "${CMAKE_CURRENT_BINARY_DIR}/UpnpLibQtConfig.cmake" 0071 INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} 0072 ) 0073 0074 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/upnplibqt_version.h 0075 DESTINATION ${KDE_INSTALL_INCLUDEDIR} 0076 COMPONENT Devel) 0077 0078 install(FILES 0079 "${CMAKE_CURRENT_BINARY_DIR}/UpnpLibQtConfig.cmake" 0080 "${CMAKE_CURRENT_BINARY_DIR}/UpnpLibQtConfigVersion.cmake" 0081 DESTINATION "${CMAKECONFIG_INSTALL_DIR}" 0082 COMPONENT Devel) 0083 0084 install(EXPORT UpnpLibQtTargets 0085 DESTINATION "${CMAKECONFIG_INSTALL_DIR}" 0086 FILE UpnpLibQtTargets.cmake 0087 NAMESPACE UPNP::) 0088 0089 install(FILES upnplibqt.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}) 0090 0091 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)