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 "23")
0005 set (RELEASE_SERVICE_VERSION_MINOR "07")
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 if (SAILFISHOS)
0012     set(KF5_MIN_VERSION "5.36.0")
0013     set(QT_MIN_VERSION "5.6.0")
0014 else()
0015     set(KF5_MIN_VERSION "5.101.0")
0016     set(QT_MIN_VERSION "5.15.2")
0017     set(KDE_COMPILERSETTINGS_LEVEL "5.84.0")
0018 endif()
0019 set(KDE_COMPILERSETTINGS_LEVEL "5.82")
0020 set(QCA_MIN_VERSION "2.1.0")
0021 
0022 find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
0023 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
0024 
0025 set(CMAKE_C_STANDARD 99)
0026 set(CMAKE_CXX_STANDARD 17)
0027 set(CMAKE_CXX_STANDARD_REQUIRED ON)
0028 
0029 include(KDEInstallDirs)
0030 include(KDECompilerSettings NO_POLICY_SCOPE)
0031 include(KDECMakeSettings)
0032 include(ECMAddTests)
0033 include(ECMSetupVersion)
0034 include(ECMInstallIcons)
0035 include(ECMQtDeclareLoggingCategory)
0036 include(FeatureSummary)
0037 include(GenerateExportHeader)
0038 include(ECMGenerateQmlTypes)
0039 include(KDEClangFormat)
0040 include(KDEGitCommitHooks)
0041 include(ECMQmlModule)
0042 if (NOT SAILFISHOS)
0043     include(ECMQMLModules)
0044 endif()
0045 
0046 include(KDEConnectMacros.cmake)
0047 
0048 ecm_setup_version(${RELEASE_SERVICE_VERSION}
0049     VARIABLE_PREFIX KDECONNECT
0050     VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/kdeconnect-version.h
0051 )
0052 
0053 # Make the version header available by linking against kdeconnectversion
0054 add_library(kdeconnectversion INTERFACE)
0055 target_include_directories(kdeconnectversion INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
0056 
0057 if (SAILFISHOS)
0058     set(KF5_REQUIRED_COMPONENTS I18n CoreAddons Config)
0059     set(KF5_OPTIONAL_COMPONENTS)
0060 
0061     set(Qca_LIBRARY CONAN_PKG::Qca-qt5)
0062 
0063     add_definitions(-DSAILFISHOS)
0064 else()
0065     find_package(Qca-qt${QT_MAJOR_VERSION} ${QCA_MIN_VERSION} REQUIRED)
0066     set(Qca_LIBRARY qca-qt${QT_MAJOR_VERSION})
0067 
0068     set(KF5_REQUIRED_COMPONENTS I18n ConfigWidgets DBusAddons IconThemes Notifications KIO KCMUtils Service Solid Kirigami2 People WindowSystem GuiAddons)
0069     set(KF5_OPTIONAL_COMPONENTS DocTools)
0070 
0071     set_package_properties(KF5Kirigami2 PROPERTIES
0072         DESCRIPTION "QtQuick plugins to build user interfaces based on KDE UX guidelines"
0073         PURPOSE "Required for KDE Connect's QML-based GUI applications"
0074         URL "https://www.kde.org/products/kirigami/"
0075         TYPE RUNTIME
0076     )
0077 
0078     if(UNIX AND NOT APPLE)
0079         find_package(KF5Package REQUIRED)
0080         find_package(KF5PulseAudioQt)
0081         if (QT_MAJOR_VERSION EQUAL "5")
0082             find_package(QtWaylandScanner REQUIRED)
0083         endif()
0084         find_package(Wayland 1.9 REQUIRED Client)
0085         find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS WaylandClient)
0086         find_package(WaylandProtocols REQUIRED)
0087         pkg_check_modules(XkbCommon IMPORTED_TARGET xkbcommon)
0088         pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)
0089     endif()
0090 
0091     find_package(KF5PeopleVCard)
0092     set_package_properties(KF5PeopleVCard PROPERTIES
0093         PURPOSE "Read vcards from the file system"
0094         URL "https://invent.kde.org/pim/kpeoplevcard"
0095         TYPE RUNTIME
0096     )
0097 
0098     add_definitions(-DHAVE_KIO)
0099 
0100     #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
0101     ecm_find_qmlmodule(QtQuick.Particles 2.0)
0102 
0103 endif()
0104 
0105 add_definitions(-DQT_NO_URL_CAST_FROM_STRING -DQT_NO_KEYWORDS -DQT_NO_CAST_FROM_ASCII)
0106 
0107 find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS DBus Quick QuickControls2 Network Multimedia)
0108 if (UNIX AND NOT APPLE AND QT_MAJOR_VERSION EQUAL "5")
0109     find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS X11Extras)
0110 endif()
0111 find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS ${KF5_REQUIRED_COMPONENTS})
0112 if (KF5_OPTIONAL_COMPONENTS)
0113     find_package(KF5 ${KF5_MIN_VERSION} OPTIONAL_COMPONENTS ${KF5_OPTIONAL_COMPONENTS})
0114 endif()
0115 
0116 if (WIN32)
0117     get_filename_component(WINDOWS_KITS_DIR
0118         "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]" ABSOLUTE)
0119     file(READ "${WINDOWS_KITS_DIR}/SDKManifest.xml" SDK_MANIFEST)
0120     string(REGEX MATCH "PlatformIdentity[^\n]*" PLATFORM_IDENTITY "${SDK_MANIFEST}" )
0121     string(REGEX MATCH "[0-9][0-9][0-9][0-9][0-9]" WIN_SDK_VERSION "${PLATFORM_IDENTITY}" )
0122     add_compile_definitions(WIN_SDK_VERSION=${WIN_SDK_VERSION})
0123 endif()
0124 
0125 add_subdirectory(core)
0126 add_subdirectory(plugins)
0127 add_subdirectory(interfaces)
0128 
0129 if (NOT SAILFISHOS)
0130 
0131     find_package(KF5QQC2DesktopStyle ${KF5_MIN_VERSION} REQUIRED)
0132     set_package_properties(KF5QQC2DesktopStyle PROPERTIES TYPE RUNTIME)
0133 
0134     add_subdirectory(icons)
0135     add_subdirectory(data)
0136     add_subdirectory(cli)
0137     add_subdirectory(declarativeplugin)
0138 
0139     add_subdirectory(kcm)
0140     add_subdirectory(kcmplugin)
0141     add_subdirectory(daemon)
0142     add_subdirectory(app)
0143     add_subdirectory(indicator)
0144     add_subdirectory(urlhandler)
0145     add_subdirectory(nautilus-extension)
0146     add_subdirectory(fileitemactionplugin)
0147     add_subdirectory(smsapp)
0148     add_subdirectory(settings)
0149 
0150     if(NOT WIN32 AND NOT APPLE)
0151         add_subdirectory(kio)
0152         add_subdirectory(plasmoid)
0153     endif()
0154 endif()
0155 
0156 if(KF5DocTools_FOUND)
0157     add_subdirectory(doc)
0158     kdoctools_install(po)
0159 endif()
0160 ki18n_install(po)
0161 
0162 if(BUILD_TESTING)
0163     add_subdirectory(tests)
0164 endif()
0165 
0166 ecm_qt_install_logging_categories(EXPORT kdeconnect-kde FILE kdeconnect-kde.categories SORT DESTINATION "${KDE_INSTALL_LOGGINGCATEGORIESDIR}")
0167 
0168 file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
0169 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
0170 
0171 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
0172 
0173 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)