Warning, /utilities/konsole/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 # Konsole project 0002 0003 # KDE Application Version, managed by release script 0004 set (RELEASE_SERVICE_VERSION_MAJOR "22") 0005 set (RELEASE_SERVICE_VERSION_MINOR "11") 0006 set (RELEASE_SERVICE_VERSION_MICRO "70") 0007 set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}") 0008 0009 # Do not increase these requirements without a merge-request or/and 0010 # approval from maintainer(s). 0011 # minimal requirements 0012 0013 # See comments in https://invent.kde.org/utilities/konsole/-/commit/9d8e47298c81fc1e47c998eda1b6e980589274eb 0014 cmake_minimum_required(VERSION 3.16 FATAL_ERROR) 0015 0016 # Match KDE Frameworks update Apr 2021 0017 set (QT_MIN_VERSION "5.15.0") 0018 0019 set (KF5_MIN_VERSION "5.71.0") 0020 0021 # Release script will create bugzilla versions 0022 project(konsole VERSION ${RELEASE_SERVICE_VERSION}) 0023 0024 find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) 0025 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH}) 0026 0027 include(KDEInstallDirs) 0028 include(KDECMakeSettings) 0029 include(KDECompilerSettings NO_POLICY_SCOPE) 0030 include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) 0031 include(ECMOptionalAddSubdirectory) 0032 include(ECMInstallIcons) 0033 include(ECMSetupVersion) 0034 include(ECMMarkNonGuiExecutable) 0035 include(ECMGenerateHeaders) 0036 include(GenerateExportHeader) 0037 include(FeatureSummary) 0038 include(ECMQtDeclareLoggingCategory) 0039 include(KDEClangFormat) 0040 # Remove OPTIONAL when we require EMC >= 5.79 0041 include(KDEGitCommitHooks OPTIONAL) 0042 include(CheckFunctionExists) 0043 include(CheckIncludeFiles) 0044 0045 # Allows passing e.g. -DECM_ENABLE_SANITIZERS='address;undefined' to cmake. 0046 include(ECMEnableSanitizers) 0047 0048 if(ECM_GLOBAL_FIND_VERSION VERSION_LESS "5.82.0") 0049 if(NOT QT_MAJOR_VERSION) 0050 set(QT_MAJOR_VERSION "5") 0051 endif() 0052 endif() 0053 0054 if(QT_MAJOR_VERSION EQUAL "6") 0055 # ECMDeprecationSettings is in ECM since 5.91, this assumes if you're building 0056 # with Qt6, you have latest ECM anyway 0057 include(ECMDeprecationSettings) 0058 ecm_set_disabled_deprecation_versions( 0059 QT 5.15.2 0060 KF 5.93.0 0061 ) 0062 endif() 0063 0064 ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX KONSOLEPRIVATE 0065 SOVERSION 1 0066 ) 0067 find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED 0068 Core 0069 DBus 0070 PrintSupport 0071 Widgets 0072 ) 0073 0074 find_package(KF5 ${KF5_MIN_VERSION} REQUIRED 0075 Bookmarks 0076 Config 0077 ConfigWidgets 0078 CoreAddons 0079 Crash 0080 GlobalAccel 0081 GuiAddons 0082 DBusAddons 0083 I18n 0084 IconThemes 0085 KIO 0086 NewStuff 0087 NewStuffCore 0088 Notifications 0089 NotifyConfig 0090 Parts 0091 Pty 0092 Service 0093 TextWidgets 0094 WidgetsAddons 0095 WindowSystem 0096 XmlGui 0097 ) 0098 0099 find_package(KF5DocTools ${KF5_MIN_VERSION}) 0100 set_package_properties(KF5DocTools PROPERTIES DESCRIPTION 0101 "Tools to generate documentation" 0102 TYPE OPTIONAL 0103 ) 0104 0105 if(NOT APPLE) 0106 option(WITHOUT_X11 "Build without X11 integration (skips finding X11)" OFF) 0107 if (NOT WITHOUT_X11) 0108 find_package(X11) 0109 set_package_properties(X11 PROPERTIES TYPE OPTIONAL) 0110 set(HAVE_X11 ${X11_FOUND}) 0111 endif() 0112 endif() 0113 0114 # Check for function GETPWUID 0115 check_symbol_exists(getpwuid "pwd.h" HAVE_GETPWUID) 0116 0117 check_function_exists(malloc_trim HAVE_MALLOC_TRIM) 0118 0119 # See above includes for defaults 0120 add_definitions( 0121 -DQT_NO_FOREACH 0122 -DQT_STRICT_ITERATORS 0123 -DQT_NO_URL_CAST_FROM_STRING 0124 ) 0125 0126 set(CMAKE_CXX_STANDARD 17) 0127 set(CMAKE_CXX_STANDARD_REQUIRED ON) 0128 set(CMAKE_CXX_EXTENSIONS OFF) 0129 0130 include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ) 0131 0132 file(GLOB ICONS_SRCS "data/icons/*.png") 0133 0134 option(ENABLE_PLUGIN_SSHMANAGER "Build the SSHManager plugin" ON) 0135 option(ENABLE_PLUGIN_QUICKCOMMANDS "Build the Quick Commands plugin" ON) 0136 0137 add_subdirectory( src ) 0138 add_subdirectory( data ) 0139 add_subdirectory( desktop ) 0140 add_subdirectory( kconf_update ) 0141 if (KF5DocTools_FOUND) 0142 add_subdirectory( doc/manual ) 0143 endif() 0144 0145 add_subdirectory( tools ) 0146 0147 # Conditionally install icons for Linux as they may not be provided by the user theme 0148 option(INSTALL_ICONS "Install icons" OFF) 0149 if (INSTALL_ICONS) 0150 include(ECMInstallIcons) 0151 ecm_install_icons( ICONS ${ICONS_SRCS} DESTINATION ${KDE_INSTALL_ICONDIR} ) 0152 endif() 0153 0154 ecm_qt_install_logging_categories( 0155 EXPORT KONSOLE 0156 FILE konsole.categories 0157 DESTINATION "${KDE_INSTALL_LOGGINGCATEGORIESDIR}" 0158 ) 0159 0160 ki18n_install( po ) 0161 if (KF5DocTools_FOUND) 0162 kdoctools_install( po ) 0163 endif() 0164 0165 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) 0166 0167 # add clang-format target for all our real source files 0168 file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.c *.cpp *.h *.hpp) 0169 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES}) 0170 if (ECM_VERSION VERSION_GREATER_EQUAL 5.79.0) 0171 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT) 0172 endif()