Warning, /frameworks/bluez-qt/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 cmake_minimum_required(VERSION 3.16)
0002 
0003 set(KF_VERSION "5.116.0") # handled by release scripts
0004 project(BluezQt VERSION ${KF_VERSION})
0005 
0006 include(FeatureSummary)
0007 find_package(ECM 5.115.0 NO_MODULE)
0008 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules")
0009 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
0010 
0011 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
0012 
0013 include(KDEInstallDirs)
0014 include(KDECMakeSettings)
0015 include(KDEGitCommitHooks)
0016 include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
0017 
0018 include(FeatureSummary)
0019 include(ECMGenerateExportHeader)
0020 include(ECMSetupVersion)
0021 include(ECMGenerateHeaders)
0022 include(ECMAddQch)
0023 include(CMakePackageConfigHelpers)
0024 include(ECMQtDeclareLoggingCategory)
0025 include(ECMGeneratePkgConfigFile)
0026 include(ECMQmlModule)
0027 include(ECMDeprecationSettings)
0028 
0029 set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].")
0030 
0031 option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF)
0032 add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)")
0033 
0034 ecm_setup_version(PROJECT
0035     VARIABLE_PREFIX BLUEZQT
0036     VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/bluezqt_version.h"
0037     PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5BluezQtConfigVersion.cmake"
0038     SOVERSION 6
0039 )
0040 
0041 # Dependencies
0042 set(REQUIRED_QT_VERSION 5.15.2)
0043 
0044 # Required Qt components to build this framework
0045 find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core DBus Network)
0046 
0047 # Optional Qt components to build this framework
0048 find_package(Qt${QT_MAJOR_VERSION}Test ${REQUIRED_QT_VERSION} CONFIG)
0049 set_package_properties(Qt${QT_MAJOR_VERSION}Test PROPERTIES DESCRIPTION "Autotests for BluezQt" TYPE OPTIONAL)
0050 find_package(Qt${QT_MAJOR_VERSION}Qml ${REQUIRED_QT_VERSION} CONFIG)
0051 set_package_properties(Qt${QT_MAJOR_VERSION}Qml PROPERTIES DESCRIPTION "QML support for BluezQt" TYPE OPTIONAL)
0052 find_package(Qt${QT_MAJOR_VERSION}QuickTest ${REQUIRED_QT_VERSION} CONFIG)
0053 set_package_properties(Qt${QT_MAJOR_VERSION}QuickTest PROPERTIES DESCRIPTION "QML autotests for BluezQt" TYPE OPTIONAL)
0054 
0055 ecm_set_disabled_deprecation_versions(
0056     QT 5.15.2
0057 )
0058 
0059 # Subdirectories
0060 add_subdirectory(src)
0061 add_subdirectory(tools/bluezapi2qt)
0062 
0063 if (BUILD_TESTING)
0064     add_subdirectory(tests)
0065     if(Qt${QT_MAJOR_VERSION}Test_FOUND)
0066         add_subdirectory(autotests)
0067     endif()
0068 endif()
0069 
0070 if(Qt${QT_MAJOR_VERSION}Qml_FOUND)
0071     add_subdirectory(src/imports)
0072 endif()
0073 
0074 # Create a Config.cmake and a ConfigVersion.cmake file and install them
0075 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5BluezQt")
0076 
0077 if (BUILD_QCH)
0078     ecm_install_qch_export(
0079         TARGETS KF5BluezQt_QCH
0080         FILE KF5BluezQtQchTargets.cmake
0081         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0082         COMPONENT Devel
0083     )
0084     set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF5BluezQtQchTargets.cmake\")")
0085 endif()
0086 
0087 configure_package_config_file(
0088     "${CMAKE_CURRENT_SOURCE_DIR}/KF5BluezQtConfig.cmake.in"
0089     "${CMAKE_CURRENT_BINARY_DIR}/KF5BluezQtConfig.cmake"
0090     INSTALL_DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0091 )
0092 
0093 install(FILES
0094     "${CMAKE_CURRENT_BINARY_DIR}/KF5BluezQtConfig.cmake"
0095     "${CMAKE_CURRENT_BINARY_DIR}/KF5BluezQtConfigVersion.cmake"
0096     DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0097     COMPONENT Devel)
0098 
0099 install(EXPORT KF5BluezQtTargets
0100     DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0101     FILE KF5BluezQtTargets.cmake
0102     NAMESPACE KF5::)
0103 
0104 install(FILES
0105     ${CMAKE_CURRENT_BINARY_DIR}/bluezqt_version.h
0106     DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/BluezQt
0107     COMPONENT Devel)
0108 
0109 if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
0110     set(INSTALL_UDEV_RULE ON CACHE BOOL "Whether to install udev rule")
0111     set(UDEV_RULES_INSTALL_DIR /lib/udev/rules.d CACHE PATH "The location of udev rules")
0112 
0113     if(${INSTALL_UDEV_RULE})
0114         install(FILES 61-kde-bluetooth-rfkill.rules DESTINATION ${UDEV_RULES_INSTALL_DIR})
0115     endif()
0116 
0117     ecm_generate_pkgconfig_file(BASE_NAME KF5BluezQt
0118       INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF}/BluezQt/
0119       DEPS "Qt${QT_MAJOR_VERSION}Core Qt${QT_MAJOR_VERSION}Network Qt${QT_MAJOR_VERSION}DBus"
0120     INSTALL)
0121 
0122 endif()
0123 
0124 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
0125 
0126 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)