Warning, /graphics/spectacle/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 
0002 # KDE Application Version, managed by release script
0003 set(RELEASE_SERVICE_VERSION_MAJOR "24")
0004 set(RELEASE_SERVICE_VERSION_MINOR "01")
0005 set(RELEASE_SERVICE_VERSION_MICRO "95")
0006 set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
0007 set(SPECTACLE_VERSION ${RELEASE_SERVICE_VERSION})
0008 # minimum requirements
0009 
0010 cmake_minimum_required (VERSION 3.16 FATAL_ERROR)
0011 # Spectacle project
0012 project(Spectacle VERSION ${SPECTACLE_VERSION})
0013 
0014 set(QT_MIN_VERSION "6.5.2")
0015 set(KF_MIN_VERSION "5.240.0")
0016 
0017 find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
0018 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
0019 
0020 # set up standard kde build settings
0021 
0022 include(KDEInstallDirs)
0023 include(KDECMakeSettings)
0024 include(KDECompilerSettings NO_POLICY_SCOPE)
0025 
0026 # Set C++ standard separately from KDECompilerSettings since that is set to an older C++ standard.
0027 set(CMAKE_CXX_STANDARD 20)
0028 set(CMAKE_CXX_STANDARD_REQUIRED ON)
0029 
0030 # used cmake macros
0031 
0032 include(ECMInstallIcons)
0033 include(ECMSetupVersion)
0034 include(FeatureSummary)
0035 include(ECMQtDeclareLoggingCategory)
0036 include(ECMAddTests)
0037 include(KDEClangFormat)
0038 include(KDEGitCommitHooks)
0039 include(ECMDeprecationSettings)
0040 include(ECMFindQmlModule)
0041 
0042 # find dependencies
0043 
0044 find_package(
0045     Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED
0046         Core
0047         Concurrent
0048         Qml
0049         Quick
0050         QuickControls2
0051         QuickTemplates2
0052         Widgets
0053         DBus
0054         PrintSupport
0055         Test
0056         WaylandClient
0057         Multimedia
0058 )
0059 qt_policy(SET QTP0001 NEW)
0060 
0061 find_package(
0062     KF6 ${KF_MIN_VERSION} REQUIRED
0063         CoreAddons
0064         WidgetsAddons
0065         DBusAddons
0066         Notifications
0067         Config
0068         I18n
0069         KIO
0070         WindowSystem
0071         GlobalAccel
0072         XmlGui
0073         GuiAddons
0074         KirigamiPlatform
0075 )
0076 
0077 find_package(Wayland REQUIRED COMPONENTS Client)
0078 find_package(PlasmaWaylandProtocols REQUIRED)
0079 find_package(LayerShellQt REQUIRED)
0080 find_package(KPipeWire)
0081 set_package_properties(KPipeWire PROPERTIES DESCRIPTION
0082     "Used to record pipewire streams into a file"
0083     TYPE REQUIRED
0084 )
0085 
0086 # optional components
0087 find_package(KF6DocTools ${KF_MIN_VERSION})
0088 set_package_properties(KF6DocTools PROPERTIES DESCRIPTION
0089     "Tools to generate documentation"
0090     TYPE OPTIONAL
0091 )
0092 find_package(KF6Purpose)
0093 if (KF6Purpose_FOUND)
0094     set(PURPOSE_FOUND 1)
0095 endif()
0096 
0097 find_package(XCB COMPONENTS XFIXES IMAGE UTIL CURSOR RANDR)
0098 set(XCB_COMPONENTS_ERRORS FALSE)
0099 set(XCB_COMPONENTS_FOUND TRUE)
0100 if(NOT XCB_XFIXES_FOUND)
0101         set(XCB_COMPONENTS_ERRORS "${XCB_COMPONENTS_ERRORS} XCB-XFIXES ")
0102         set(XCB_COMPONENTS_FOUND FALSE)
0103 endif()
0104 if(NOT XCB_IMAGE_FOUND)
0105         set(XCB_COMPONENTS_ERRORS "${XCB_COMPONENTS_ERRORS} XCB-IMAGE ")
0106         set(XCB_COMPONENTS_FOUND FALSE)
0107 endif()
0108 if(NOT XCB_UTIL_FOUND)
0109         set(XCB_COMPONENTS_ERRORS "${XCB_COMPONENTS_ERRORS} XCB-UTIL ")
0110         set(XCB_COMPONENTS_FOUND FALSE)
0111 endif()
0112 if(NOT XCB_CURSOR_FOUND)
0113         set(XCB_COMPONENTS_ERRORS "${XCB_COMPONENTS_ERRORS} XCB-CURSOR ")
0114         set(XCB_COMPONENTS_FOUND FALSE)
0115 endif()
0116 
0117 # fail build if none of the platform backends can be found
0118 if (NOT XCB_FOUND OR NOT XCB_COMPONENTS_FOUND)
0119     message(FATAL_ERROR "No suitable backend platform was found. Currently supported platforms are: XCB Components Required: ${XCB_COMPONENTS_ERRORS}")
0120 endif()
0121 
0122 # setup handling of deprecated Qt & KF API
0123 
0124 ecm_set_disabled_deprecation_versions(QT 6.5  KF 5.240.0)
0125 
0126 # hand off to subdirectories
0127 
0128 add_subdirectory(src)
0129 add_subdirectory(dbus)
0130 add_subdirectory(desktop)
0131 add_subdirectory(icons)
0132 add_subdirectory(kconf_update)
0133 add_subdirectory(tests)
0134 
0135 if (KF6DocTools_FOUND)
0136     add_subdirectory(doc)
0137     kdoctools_install(po)
0138 endif()
0139 ki18n_install(po)
0140 
0141 ecm_qt_install_logging_categories(EXPORT SPECTACLE FILE spectacle.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
0142 
0143 # summaries
0144 
0145 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
0146 
0147 file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
0148 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
0149 
0150 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)