Warning, /network/kdeconnect-kde/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 cmake_minimum_required(VERSION 3.16)
0002 
0003 # KDE Release Service Version, managed by release script
0004 set (RELEASE_SERVICE_VERSION_MAJOR "24")
0005 set (RELEASE_SERVICE_VERSION_MINOR "04")
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(kdeconnect VERSION ${RELEASE_SERVICE_VERSION})
0010 
0011 set(KF_MIN_VERSION "5.240")
0012 set(QT_MIN_VERSION "6.6.0")
0013 
0014 find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
0015 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
0016 
0017 include(KDEInstallDirs)
0018 include(KDECompilerSettings NO_POLICY_SCOPE)
0019 include(KDECMakeSettings)
0020 include(ECMAddTests)
0021 include(ECMSetupVersion)
0022 include(ECMInstallIcons)
0023 include(ECMQtDeclareLoggingCategory)
0024 include(FeatureSummary)
0025 include(GenerateExportHeader)
0026 include(ECMGenerateQmlTypes)
0027 include(KDEClangFormat)
0028 include(KDEGitCommitHooks)
0029 include(ECMFindQmlModule)
0030 include(ECMQmlModule)
0031 include(ECMDeprecationSettings)
0032 
0033 include(KDEConnectMacros.cmake)
0034 
0035 ecm_setup_version(${RELEASE_SERVICE_VERSION}
0036     VARIABLE_PREFIX KDECONNECT
0037     VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/kdeconnect-version.h
0038 )
0039 
0040 ecm_set_disabled_deprecation_versions(
0041     QT 5.15
0042     KF 5.110
0043 )
0044 
0045 # Make the version header available by linking against kdeconnectversion
0046 add_library(kdeconnectversion INTERFACE)
0047 target_include_directories(kdeconnectversion INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
0048 
0049 set_package_properties(KF6Kirigami2 PROPERTIES
0050     DESCRIPTION "QtQuick plugins to build user interfaces based on KDE UX guidelines"
0051     PURPOSE "Required for KDE Connect's QML-based GUI applications"
0052     URL "https://www.kde.org/products/kirigami/"
0053     TYPE RUNTIME
0054 )
0055 
0056 find_package(KF6KirigamiAddons 0.11 REQUIRED)
0057 set_package_properties(KF6KirigamiAddons PROPERTIES
0058     TYPE REQUIRED
0059     PURPOSE "Required runtime dependency (all the modules are required)"
0060 )
0061 
0062 if(UNIX AND NOT APPLE)
0063     option(WITH_X11 "Build with X11 support" ON)
0064     option(WITH_PULSEAUDIO "Build with Pulseaudio support" ON)
0065 else()
0066     set(WITH_X11 OFF)
0067     set(WITH_PULSEAUDIO OFF)
0068 endif()
0069 
0070 if(UNIX AND NOT APPLE)
0071     find_package(KF6Package REQUIRED)
0072     if (WITH_PULSEAUDIO)
0073         find_package(KF6PulseAudioQt REQUIRED)
0074     endif()
0075     find_package(QtWaylandScanner REQUIRED)
0076     find_package(Wayland 1.9 REQUIRED Client)
0077     find_package(Qt6 REQUIRED COMPONENTS WaylandClient)
0078     find_package(WaylandProtocols REQUIRED)
0079     pkg_check_modules(XkbCommon IMPORTED_TARGET xkbcommon)
0080     find_package(PkgConfig QUIET REQUIRED)
0081     pkg_check_modules(DBus REQUIRED IMPORTED_TARGET dbus-1)
0082 endif()
0083 
0084 if (NOT WIN32)
0085     find_package(KF6StatusNotifierItem ${KF_MIN_VERSION} REQUIRED)
0086 endif()
0087 
0088 #ecm_find_qmlmodule(org.kde.people 1.0) FIXME This results in KPeople code being called which triggers DBus calls which breaks the Windows CI
0089 ecm_find_qmlmodule(QtQuick.Particles 2.0)
0090 
0091 add_definitions(-DQT_NO_URL_CAST_FROM_STRING -DQT_NO_KEYWORDS -DQT_NO_CAST_FROM_ASCII)
0092 
0093 find_package(Qt6 ${QT_MIN_VERSION} REQUIRED COMPONENTS DBus Quick QuickControls2 Network Multimedia)
0094 find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS I18n ConfigWidgets DBusAddons IconThemes Notifications
0095     KIO KCMUtils Service Solid Kirigami People WindowSystem GuiAddons DocTools)
0096 
0097 if (WIN32)
0098     get_filename_component(WINDOWS_KITS_DIR
0099         "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]" ABSOLUTE)
0100     file(READ "${WINDOWS_KITS_DIR}/SDKManifest.xml" SDK_MANIFEST)
0101     string(REGEX MATCH "PlatformIdentity[^\n]*" PLATFORM_IDENTITY "${SDK_MANIFEST}" )
0102     string(REGEX MATCH "[0-9][0-9][0-9][0-9][0-9]" WIN_SDK_VERSION "${PLATFORM_IDENTITY}" )
0103     add_compile_definitions(WIN_SDK_VERSION=${WIN_SDK_VERSION})
0104 endif()
0105 
0106 add_subdirectory(core)
0107 add_subdirectory(plugins)
0108 add_subdirectory(interfaces)
0109 
0110 find_package(KF6QQC2DesktopStyle ${KF_MIN_VERSION} REQUIRED)
0111 set_package_properties(KF6QQC2DesktopStyle PROPERTIES TYPE RUNTIME)
0112 
0113 add_subdirectory(icons)
0114 add_subdirectory(data)
0115 add_subdirectory(cli)
0116 add_subdirectory(declarativeplugin)
0117 
0118 add_subdirectory(kcm)
0119 add_subdirectory(kcmplugin)
0120 add_subdirectory(daemon)
0121 add_subdirectory(app)
0122 add_subdirectory(indicator)
0123 add_subdirectory(urlhandler)
0124 add_subdirectory(nautilus-extension)
0125 add_subdirectory(fileitemactionplugin)
0126 add_subdirectory(smsapp)
0127 add_subdirectory(settings)
0128 
0129 if(NOT WIN32 AND NOT APPLE)
0130     add_subdirectory(kio)
0131     add_subdirectory(plasmoid)
0132 endif()
0133 
0134 add_subdirectory(doc)
0135 kdoctools_install(po)
0136 
0137 ki18n_install(po)
0138 
0139 if(BUILD_TESTING)
0140     add_subdirectory(tests)
0141 endif()
0142 
0143 ecm_qt_install_logging_categories(EXPORT kdeconnect-kde FILE kdeconnect-kde.categories SORT DESTINATION "${KDE_INSTALL_LOGGINGCATEGORIESDIR}")
0144 
0145 file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
0146 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
0147 
0148 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
0149 
0150 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)