Warning, /frameworks/kirigami/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(kirigami2 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 "kirigami requires an out of source build. Please create a separate build directory and run 'cmake path_to_kirigami [options]' there.") 0014 endif() 0015 0016 option(BUILD_SHARED_LIBS "Build a shared module" ON) 0017 option(DESKTOP_ENABLED "Build and install The Desktop style" ON) 0018 option(BUILD_EXAMPLES "Build and install examples" OFF) 0019 option(DISABLE_DBUS "Build without D-Bus support" OFF) 0020 option(UBUNTU_TOUCH "Build for Ubuntu Touch" OFF) 0021 if(DEFINED STATIC_LIBRARY) 0022 message(FATAL_ERROR "Use the BUILD_SHARED_LIBS=OFF option to build a static library, STATIC_LIBRARY is no longer a supported option") 0023 endif() 0024 find_package(ECM 5.115.0 NO_MODULE) 0025 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH}) 0026 0027 if (NOT ${BUILD_SHARED_LIBS}) 0028 # Examples are not supported when building a static library, so force them 0029 # to OFF. 0030 set(BUILD_EXAMPLES OFF) 0031 endif() 0032 0033 # Make CPack available to easy generate binary packages 0034 include(CPack) 0035 include(FeatureSummary) 0036 include(KDEInstallDirs) 0037 find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Gui Svg QuickControls2 Concurrent) 0038 if (QT_MAJOR_VERSION EQUAL "6") 0039 find_package(Qt6 REQUIRED NO_MODULE COMPONENTS ShaderTools) 0040 endif() 0041 if (BUILD_TESTING) 0042 find_package(Qt${QT_MAJOR_VERSION}QuickTest ${REQUIRED_QT_VERSION} CONFIG QUIET) 0043 endif() 0044 get_target_property(QtGui_Enabled_Features Qt${QT_MAJOR_VERSION}::Gui QT_ENABLED_PUBLIC_FEATURES) 0045 if(QtGui_Enabled_Features MATCHES "opengl") 0046 set(HAVE_QTGUI_OPENGL 1) 0047 else() 0048 set(HAVE_QTGUI_OPENGL 0) 0049 endif() 0050 add_feature_info(QtGuiOpenGL HAVE_QTGUI_OPENGL "QtGui built with support for OpenGL") 0051 set(CMAKE_AUTOMOC ON) 0052 set(AUTOMOC_MOC_OPTIONS -Muri=org.kde.kirigami) 0053 set(CMAKE_INCLUDE_CURRENT_DIR ON) 0054 0055 if(NOT BUILD_SHARED_LIBS) 0056 add_definitions(-DKIRIGAMI_BUILD_TYPE_STATIC) 0057 add_definitions(-DQT_PLUGIN) 0058 add_definitions(-DQT_STATICPLUGIN=1) 0059 endif() 0060 0061 ################# set KDE specific information ################# 0062 # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked 0063 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules") 0064 0065 include(ECMGenerateExportHeader) 0066 include(ECMSetupVersion) 0067 include(ECMGenerateHeaders) 0068 include(CMakePackageConfigHelpers) 0069 include(ECMPoQmTools) 0070 include(ECMFindQmlModule) 0071 include(KDEInstallDirs) 0072 include(KDECMakeSettings) 0073 include(KDEGitCommitHooks) 0074 include(ECMQtDeclareLoggingCategory) 0075 include(ECMAddQch) 0076 include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) 0077 include(KDEPackageAppTemplates) 0078 include(ECMGenerateQmlTypes) 0079 include(ECMQmlModule) 0080 include(ECMDeprecationSettings) 0081 0082 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Kirigami2") 0083 0084 option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF) 0085 add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)") 0086 0087 configure_package_config_file( 0088 "${CMAKE_CURRENT_SOURCE_DIR}/KF5Kirigami2Config.cmake.in" 0089 "${CMAKE_CURRENT_BINARY_DIR}/KF5Kirigami2Config.cmake" 0090 INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} 0091 PATH_VARS CMAKE_INSTALL_PREFIX 0092 ) 0093 0094 install(FILES 0095 "${CMAKE_CURRENT_BINARY_DIR}/KF5Kirigami2Config.cmake" 0096 "${CMAKE_CURRENT_BINARY_DIR}/KF5Kirigami2ConfigVersion.cmake" 0097 "${CMAKE_CURRENT_SOURCE_DIR}/KF5Kirigami2Macros.cmake" 0098 DESTINATION "${CMAKECONFIG_INSTALL_DIR}" 0099 COMPONENT Devel 0100 ) 0101 0102 install(EXPORT KF5Kirigami2Targets 0103 DESTINATION "${CMAKECONFIG_INSTALL_DIR}" 0104 FILE KF5Kirigami2Targets.cmake 0105 NAMESPACE KF5:: 0106 ) 0107 0108 0109 ecm_setup_version(${KF_VERSION} 0110 VARIABLE_PREFIX KIRIGAMI2 0111 VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kirigami_version.h" 0112 PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5Kirigami2ConfigVersion.cmake" 0113 SOVERSION 5 0114 ) 0115 0116 #use dbus on linux, bsd etc, but not android and apple stuff 0117 if (UNIX AND NOT ANDROID AND NOT(APPLE) AND NOT(DISABLE_DBUS)) 0118 find_package(Qt${QT_MAJOR_VERSION}DBus) 0119 add_definitions(-DKIRIGAMI_ENABLE_DBUS) 0120 endif() 0121 0122 find_package(OpenMP) 0123 set_package_properties(OpenMP 0124 PROPERTIES DESCRIPTION "Multi-platform shared-memory parallel programming in C/C++ and Fortran" 0125 TYPE OPTIONAL 0126 PURPOSE "Accelerates palette generation in Kirigami.ImageColors" 0127 ) 0128 if(OpenMP_CXX_FOUND) 0129 set(HAVE_OpenMP TRUE) 0130 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") 0131 endif() 0132 0133 include_directories("${CMAKE_CURRENT_BINARY_DIR}") 0134 configure_file(config-OpenMP.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-OpenMP.h) 0135 0136 if (UBUNTU_TOUCH) 0137 add_definitions(-DUBUNTU_TOUCH) 0138 endif() 0139 0140 ecm_find_qmlmodule(QtGraphicalEffects 1.0) 0141 0142 ecm_set_disabled_deprecation_versions( 0143 QT 5.15.2 0144 KF 5.95 0145 ) 0146 0147 add_subdirectory(src) 0148 if (NOT ANDROID) 0149 add_subdirectory(templates) 0150 endif() 0151 0152 if (BUILD_EXAMPLES) 0153 add_subdirectory(examples) 0154 endif() 0155 0156 if (BUILD_TESTING) 0157 add_subdirectory(autotests) 0158 endif() 0159 0160 ecm_install_po_files_as_qm(poqm) 0161 0162 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) 0163 0164 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)