Warning, /frameworks/qqc2-desktop-style/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 set(KF_DEP_VERSION "5.249.0") # handled by release scripts 0005 0006 project(qqc2-desktop-style VERSION ${KF_VERSION}) 0007 0008 set(REQUIRED_QT_VERSION 6.5.0) 0009 0010 ################# Disallow in-source build ################# 0011 0012 if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") 0013 message(FATAL_ERROR "qqc2-desktop-style requires an out of source build. Please create a separate build directory and run 'cmake path_to_qqc2-desktop-style [options]' there.") 0014 endif() 0015 0016 0017 # Make CPack available to easy generate binary packages 0018 include(CPack) 0019 include(FeatureSummary) 0020 0021 ################# set KDE specific information ################# 0022 0023 find_package(ECM 5.249.0 REQUIRED NO_MODULE) 0024 0025 # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked 0026 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH}) 0027 0028 include(KDEInstallDirs) 0029 include(ECMSetupVersion) 0030 include(ECMGenerateHeaders) 0031 include(ECMQmlModule) 0032 include(ECMQMLModules) 0033 include(KDECMakeSettings) 0034 include(KDEGitCommitHooks) 0035 include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) 0036 include(ECMDeprecationSettings) 0037 0038 find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Gui Widgets QuickControls2 DBus) 0039 0040 if (BUILD_TESTING) 0041 include(ECMAddTests) 0042 find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Test QuickTest) 0043 endif() 0044 0045 find_package(KF6 ${KF_DEP_VERSION} REQUIRED COMPONENTS Config KirigamiPlatform) 0046 0047 # IconThemes and ColorScheme are optional 0048 find_package(KF6IconThemes ${KF_DEP_VERSION}) 0049 find_package(KF6ColorScheme ${KF_DEP_VERSION}) 0050 0051 if (NOT APPLE AND NOT WIN32) 0052 find_package(X11) 0053 endif() 0054 0055 set_package_properties(IconThemes 0056 PROPERTIES 0057 DESCRIPTION "KF6 IconThemes framework" 0058 TYPE OPTIONAL 0059 PURPOSE "Optional integration of Kirigami with KIconLoader icons handling for a better integration with Plasma Desktop" 0060 ) 0061 set_package_properties(ColorScheme 0062 PROPERTIES 0063 DESCRIPTION "KF6 ColorScheme framework" 0064 TYPE OPTIONAL 0065 PURPOSE "Optional integration of Kirigami with KColorScheme for color palettes integration with Plasma Desktop" 0066 ) 0067 0068 find_package(PkgConfig) 0069 0070 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF6QQC2DesktopStyle") 0071 0072 configure_package_config_file( 0073 "${CMAKE_CURRENT_SOURCE_DIR}/KF6QQC2DesktopStyleConfig.cmake.in" 0074 "${CMAKE_CURRENT_BINARY_DIR}/KF6QQC2DesktopStyleConfig.cmake" 0075 INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} 0076 PATH_VARS CMAKE_INSTALL_PREFIX 0077 ) 0078 0079 install(FILES 0080 "${CMAKE_CURRENT_BINARY_DIR}/KF6QQC2DesktopStyleConfig.cmake" 0081 "${CMAKE_CURRENT_BINARY_DIR}/KF6QQC2DesktopStyleConfigVersion.cmake" 0082 DESTINATION "${CMAKECONFIG_INSTALL_DIR}" 0083 COMPONENT Devel 0084 ) 0085 0086 ecm_setup_version(PROJECT 0087 VARIABLE_PREFIX QQC2DESKTOPSTYLE 0088 PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF6QQC2DesktopStyleConfigVersion.cmake" 0089 SOVERSION 6 0090 ) 0091 0092 ecm_find_qmlmodule(org.kde.sonnet 1.0) 0093 0094 ######################################################################### 0095 ecm_set_disabled_deprecation_versions( 0096 QT 6.5 0097 KF 5.102 0098 ) 0099 0100 add_subdirectory(plugin) 0101 0102 if (KF6IconThemes_FOUND AND KF6ColorScheme_FOUND) 0103 add_subdirectory(kirigami-plasmadesktop-integration) 0104 endif() 0105 0106 ecm_add_qml_module(org_kde_desktop URI "org.kde.desktop" VERSION 1.0 GENERATE_PLUGIN_SOURCE) 0107 0108 file(GLOB _public_qml "org.kde.desktop/*.qml") 0109 ecm_target_qml_sources(org_kde_desktop 0110 VERSION 1.0 0111 SOURCES ${_public_qml} 0112 ) 0113 0114 # Private module goes separately, beacuse a type in qmldir can not be both internal and singleton 0115 ecm_add_qml_module(org_kde_desktop_private URI "org.kde.desktop.private" VERSION 1.0 GENERATE_PLUGIN_SOURCE) 0116 0117 set_source_files_properties( 0118 org.kde.desktop/private/GlobalSonnetSettings.qml 0119 org.kde.desktop/private/MobileTextActionsToolBar.qml 0120 org.kde.desktop/private/TextFieldContextMenu.qml 0121 0122 PROPERTIES 0123 QT_QML_SINGLETON_TYPE TRUE 0124 ) 0125 0126 file(GLOB _private_qml "org.kde.desktop/private/*.qml") 0127 ecm_target_qml_sources(org_kde_desktop_private 0128 VERSION 1.0 0129 SOURCES ${_private_qml} 0130 ) 0131 0132 ecm_finalize_qml_module(org_kde_desktop DESTINATION ${KDE_INSTALL_QMLDIR}) 0133 ecm_finalize_qml_module(org_kde_desktop_private DESTINATION ${KDE_INSTALL_QMLDIR}) 0134 0135 include(ECMFeatureSummary) 0136 ecm_feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) 0137 0138 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)