Warning, /frameworks/networkmanager-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 "6.0.0") # handled by release scripts
0004 project(NetworkManagerQt VERSION ${KF_VERSION})
0005 
0006 include(FeatureSummary)
0007 find_package(ECM 5.249.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 
0012 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${ECM_MODULE_PATH})
0013 
0014 find_package(PkgConfig)
0015 pkg_search_module(NetworkManager REQUIRED IMPORTED_TARGET libnm>=1.4.0)
0016 pkg_search_module(Gio REQUIRED IMPORTED_TARGET gio-2.0)
0017 
0018 include(KDEInstallDirs)
0019 include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
0020 include(KDECMakeSettings)
0021 
0022 include(KDEGitCommitHooks)
0023 include(ECMDeprecationSettings)
0024 
0025 set(REQUIRED_QT_VERSION 6.5.0)
0026 find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED Core DBus Network Qml)
0027 
0028 remove_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY)
0029 
0030 include(ECMGenerateExportHeader)
0031 include(ECMSetupVersion)
0032 include(ECMGenerateHeaders)
0033 include(ECMAddQch)
0034 include(ECMQtDeclareLoggingCategory)
0035 include(ECMQmlModule)
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 VARIABLE_PREFIX NETWORKMANAGERQT
0041                         VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/networkmanagerqt_version.h"
0042                         PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF6NetworkManagerQtConfigVersion.cmake"
0043                         SOVERSION 6)
0044 ecm_set_disabled_deprecation_versions(
0045     QT 6.5
0046 )
0047 
0048 # Enable unit testing
0049 if (BUILD_TESTING)
0050     add_subdirectory(src/fakenetwork)
0051     add_subdirectory(autotests)
0052 endif ()
0053 
0054 add_subdirectory(src)
0055 ##################  examples  ################################
0056 option(BUILD_EXAMPLES "Build example applications" FALSE)
0057 if (BUILD_EXAMPLES)
0058     add_subdirectory(examples)
0059 endif(BUILD_EXAMPLES)
0060 
0061 # create a Config.cmake and a ConfigVersion.cmake file and install them
0062 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF6NetworkManagerQt")
0063 
0064 if (BUILD_QCH)
0065     ecm_install_qch_export(
0066         TARGETS KF6NetworkManagerQt_QCH
0067         FILE KF6NetworkManagerQtQchTargets.cmake
0068         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0069         COMPONENT Devel
0070     )
0071     set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF6NetworkManagerQtQchTargets.cmake\")")
0072 endif()
0073 
0074 include(CMakePackageConfigHelpers)
0075 
0076 configure_package_config_file(
0077   "${CMAKE_CURRENT_SOURCE_DIR}/KF6NetworkManagerQtConfig.cmake.in"
0078   "${CMAKE_CURRENT_BINARY_DIR}/KF6NetworkManagerQtConfig.cmake"
0079   INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
0080 )
0081 
0082 install(FILES
0083   "${CMAKE_CURRENT_BINARY_DIR}/KF6NetworkManagerQtConfig.cmake"
0084   "${CMAKE_CURRENT_BINARY_DIR}/KF6NetworkManagerQtConfigVersion.cmake"
0085   DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0086   COMPONENT Devel
0087 )
0088 
0089 install(EXPORT KF6NetworkManagerQtTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF6NetworkManagerQtTargets.cmake NAMESPACE KF6:: )
0090 
0091 install(FILES
0092    ${CMAKE_CURRENT_BINARY_DIR}/networkmanagerqt_version.h
0093   DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/NetworkManagerQt COMPONENT Devel
0094 )
0095 
0096 include(ECMFeatureSummary)
0097 ecm_feature_summary(WHAT ALL   FATAL_ON_MISSING_REQUIRED_PACKAGES)
0098 
0099 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)