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 "5.116.0") # handled by release scripts
0004 set(KF_DEP_VERSION "5.115.0") # handled by release scripts
0005 
0006 project(qqc2-desktop-style VERSION ${KF_VERSION})
0007 
0008 set(REQUIRED_QT_VERSION 5.15.2)
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 
0018 # Make CPack available to easy generate binary packages
0019 include(CPack)
0020 include(FeatureSummary)
0021 
0022 ################# set KDE specific information #################
0023 
0024 find_package(ECM 5.115.0 REQUIRED NO_MODULE)
0025 
0026 # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
0027 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
0028 
0029 include(ECMSetupVersion)
0030 include(ECMGenerateHeaders)
0031 include(ECMQmlModule)
0032 include(ECMQMLModules)
0033 include(KDEInstallDirs)
0034 include(KDECMakeSettings)
0035 include(KDEGitCommitHooks)
0036 include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
0037 include(ECMDeprecationSettings)
0038 
0039 find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Gui Widgets QuickControls2 DBus)
0040 
0041 find_package(KF5 ${KF_DEP_VERSION} REQUIRED COMPONENTS Config Kirigami2)
0042 
0043 # IconThemes and ConfigWidgets are optional
0044 find_package(KF5IconThemes ${KF_DEP_VERSION})
0045 find_package(KF5ConfigWidgets ${KF_DEP_VERSION})
0046 
0047 if (NOT APPLE AND NOT WIN32)
0048     find_package(X11)
0049 endif()
0050 
0051 # When building as a static plugin, dependencies may add a -lQt5X11Extras
0052 # to the linker, in that case, it requires to have the proper variables
0053 # to exists.
0054 if(X11_FOUND)
0055     if (QT_MAJOR_VERSION STREQUAL "5")
0056         find_package(Qt5X11Extras ${REQUIRED_QT_VERSION} NO_MODULE)
0057     endif()
0058 endif()
0059 
0060 set_package_properties(IconThemes PROPERTIES DESCRIPTION "KF5 IconThemes framework"
0061                        TYPE OPTIONAL
0062                        PURPOSE "Optional integration of Kirigami with KIconLoader icons handling for a better integration with Plasma Desktop"
0063                       )
0064 set_package_properties(ConfigWidgets PROPERTIES DESCRIPTION "KF5 WidgetAddons framework"
0065                        TYPE OPTIONAL
0066                        PURPOSE "Optional integration of Kirigami with KColorScheme for color palettes integration with Plasma Desktop"
0067                       )
0068 
0069 find_package(PkgConfig)
0070 
0071 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5QQC2DesktopStyle")
0072 
0073 configure_package_config_file(
0074   "${CMAKE_CURRENT_SOURCE_DIR}/KF5QQC2DesktopStyleConfig.cmake.in"
0075   "${CMAKE_CURRENT_BINARY_DIR}/KF5QQC2DesktopStyleConfig.cmake"
0076   INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
0077   PATH_VARS  CMAKE_INSTALL_PREFIX
0078 )
0079 
0080 install(FILES
0081   "${CMAKE_CURRENT_BINARY_DIR}/KF5QQC2DesktopStyleConfig.cmake"
0082   "${CMAKE_CURRENT_BINARY_DIR}/KF5QQC2DesktopStyleConfigVersion.cmake"
0083   DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0084   COMPONENT Devel
0085 )
0086 
0087 
0088 ecm_setup_version(PROJECT
0089     VARIABLE_PREFIX QQC2DESKTOPSTYLE
0090     PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5QQC2DesktopStyleConfigVersion.cmake"
0091     SOVERSION 5)
0092 
0093 # legacy support for CMake Config files with typo KF5QQC2Desk_opStyle TODO: KF6 remove
0094 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5QQC2DeskopStyle")
0095 
0096 configure_package_config_file(
0097   "${CMAKE_CURRENT_SOURCE_DIR}/KF5QQC2DeskopStyleConfig.cmake.in"
0098   "${CMAKE_CURRENT_BINARY_DIR}/KF5QQC2DeskopStyleConfig.cmake"
0099   INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
0100   PATH_VARS  CMAKE_INSTALL_PREFIX
0101 )
0102 
0103 ecm_find_qmlmodule(org.kde.sonnet 1.0)
0104 
0105 install(FILES
0106   "${CMAKE_CURRENT_BINARY_DIR}/KF5QQC2DeskopStyleConfig.cmake"
0107   "${CMAKE_CURRENT_BINARY_DIR}/KF5QQC2DeskopStyleConfigVersion.cmake"
0108   DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0109   COMPONENT Devel
0110 )
0111 
0112 
0113 ecm_setup_version(PROJECT
0114     VARIABLE_PREFIX QQC2DESKTOPSTYLE
0115     PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5QQC2DeskopStyleConfigVersion.cmake"
0116     SOVERSION 5)
0117 
0118 #########################################################################
0119 ecm_set_disabled_deprecation_versions(
0120     QT 5.15.2
0121     KF 5.95
0122 )
0123 
0124 add_subdirectory(plugin)
0125 
0126 if (KF5IconThemes_FOUND AND KF5WidgetsAddons_FOUND)
0127 add_subdirectory(kirigami-plasmadesktop-integration)
0128 endif(KF5IconThemes_FOUND AND KF5WidgetsAddons_FOUND)
0129 
0130 if (QT_MAJOR_VERSION EQUAL "5")
0131   install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/org.kde.desktop DESTINATION ${KDE_INSTALL_QMLDIR}/QtQuick/Controls.2)
0132 else()
0133   ecm_add_qml_module(org_kde_desktop URI "org.kde.desktop" VERSION 1.0 NO_PLUGIN)
0134   file(GLOB _public_qml "org.kde.desktop/*.qml")
0135   ecm_target_qml_sources(org_kde_desktop VERSION 1.0 SOURCES ${_public_qml})
0136   file(GLOB _private_qml "org.kde.desktop/private/*.qml")
0137   ecm_target_qml_sources(org_kde_desktop VERSION 1.0 PATH private SOURCES ${_private_qml})
0138   ecm_finalize_qml_module(org_kde_desktop DESTINATION ${KDE_INSTALL_QMLDIR})
0139 endif()
0140 
0141 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
0142 
0143 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)