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 "04") 0006 set (RELEASE_SERVICE_VERSION_MICRO "1") 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 endif() 0089 0090 find_package(KF5PeopleVCard) 0091 set_package_properties(KF5PeopleVCard PROPERTIES 0092 PURPOSE "Read vcards from the file system" 0093 URL "https://invent.kde.org/pim/kpeoplevcard" 0094 TYPE RUNTIME 0095 ) 0096 0097 add_definitions(-DHAVE_KIO) 0098 0099 #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 0100 ecm_find_qmlmodule(QtQuick.Particles 2.0) 0101 0102 endif() 0103 0104 add_definitions(-DQT_NO_URL_CAST_FROM_STRING -DQT_NO_KEYWORDS -DQT_NO_CAST_FROM_ASCII) 0105 0106 find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS DBus Quick QuickControls2 Network Multimedia) 0107 if (UNIX AND NOT APPLE AND QT_MAJOR_VERSION EQUAL "5") 0108 find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS X11Extras) 0109 endif() 0110 find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS ${KF5_REQUIRED_COMPONENTS}) 0111 if (KF5_OPTIONAL_COMPONENTS) 0112 find_package(KF5 ${KF5_MIN_VERSION} OPTIONAL_COMPONENTS ${KF5_OPTIONAL_COMPONENTS}) 0113 endif() 0114 0115 if (WIN32) 0116 get_filename_component(WINDOWS_KITS_DIR 0117 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]" ABSOLUTE) 0118 file(READ "${WINDOWS_KITS_DIR}/SDKManifest.xml" SDK_MANIFEST) 0119 string(REGEX MATCH "PlatformIdentity[^\n]*" PLATFORM_IDENTITY "${SDK_MANIFEST}" ) 0120 string(REGEX MATCH "[0-9][0-9][0-9][0-9][0-9]" WIN_SDK_VERSION "${PLATFORM_IDENTITY}" ) 0121 add_compile_definitions(WIN_SDK_VERSION=${WIN_SDK_VERSION}) 0122 endif() 0123 0124 add_subdirectory(core) 0125 add_subdirectory(plugins) 0126 add_subdirectory(interfaces) 0127 0128 if (NOT SAILFISHOS) 0129 0130 find_package(KF5QQC2DesktopStyle ${KF5_MIN_VERSION} REQUIRED) 0131 set_package_properties(KF5QQC2DesktopStyle PROPERTIES TYPE RUNTIME) 0132 0133 add_subdirectory(icons) 0134 add_subdirectory(data) 0135 add_subdirectory(cli) 0136 add_subdirectory(declarativeplugin) 0137 0138 add_subdirectory(kcm) 0139 add_subdirectory(kcmplugin) 0140 add_subdirectory(daemon) 0141 add_subdirectory(app) 0142 add_subdirectory(indicator) 0143 add_subdirectory(urlhandler) 0144 add_subdirectory(nautilus-extension) 0145 add_subdirectory(fileitemactionplugin) 0146 add_subdirectory(smsapp) 0147 add_subdirectory(settings) 0148 0149 if(NOT WIN32 AND NOT APPLE) 0150 add_subdirectory(kio) 0151 add_subdirectory(plasmoid) 0152 endif() 0153 endif() 0154 0155 if(KF5DocTools_FOUND) 0156 add_subdirectory(doc) 0157 kdoctools_install(po) 0158 endif() 0159 ki18n_install(po) 0160 0161 if(BUILD_TESTING) 0162 add_subdirectory(tests) 0163 endif() 0164 0165 ecm_qt_install_logging_categories(EXPORT kdeconnect-kde FILE kdeconnect-kde.categories SORT DESTINATION "${KDE_INSTALL_LOGGINGCATEGORIESDIR}") 0166 0167 file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h) 0168 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES}) 0169 0170 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT) 0171 0172 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)