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 "23") 0005 set (RELEASE_SERVICE_VERSION_MINOR "04") 0006 set (RELEASE_SERVICE_VERSION_MICRO "1") 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 Multimedia 0071 PrintSupport 0072 Widgets 0073 ) 0074 0075 find_package(KF5 ${KF5_MIN_VERSION} REQUIRED 0076 Bookmarks 0077 Config 0078 ConfigWidgets 0079 CoreAddons 0080 Crash 0081 GuiAddons 0082 DBusAddons 0083 I18n 0084 IconThemes 0085 KIO 0086 NewStuff 0087 NewStuffCore 0088 Notifications 0089 NotifyConfig 0090 Parts 0091 Service 0092 TextWidgets 0093 WidgetsAddons 0094 WindowSystem 0095 XmlGui 0096 ) 0097 0098 if (NOT WIN32) 0099 find_package(KF5 ${KF5_MIN_VERSION} REQUIRED 0100 GlobalAccel 0101 Pty 0102 ) 0103 endif() 0104 0105 find_package(KF5DocTools ${KF5_MIN_VERSION}) 0106 set_package_properties(KF5DocTools PROPERTIES DESCRIPTION 0107 "Tools to generate documentation" 0108 TYPE OPTIONAL 0109 ) 0110 0111 find_package(ICU 61.0 COMPONENTS uc i18n REQUIRED) 0112 0113 if(NOT APPLE) 0114 option(WITHOUT_X11 "Build without X11 integration (skips finding X11)" OFF) 0115 if (NOT WITHOUT_X11) 0116 find_package(X11) 0117 set_package_properties(X11 PROPERTIES TYPE OPTIONAL) 0118 set(HAVE_X11 ${X11_FOUND}) 0119 endif() 0120 endif() 0121 0122 # Check for function GETPWUID 0123 check_symbol_exists(getpwuid "pwd.h" HAVE_GETPWUID) 0124 0125 check_function_exists(malloc_trim HAVE_MALLOC_TRIM) 0126 0127 # See above includes for defaults 0128 add_definitions( 0129 -DQT_NO_FOREACH 0130 -DQT_STRICT_ITERATORS 0131 -DQT_NO_URL_CAST_FROM_STRING 0132 ) 0133 0134 set(CMAKE_CXX_STANDARD 17) 0135 set(CMAKE_CXX_STANDARD_REQUIRED ON) 0136 set(CMAKE_CXX_EXTENSIONS OFF) 0137 0138 include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ) 0139 0140 file(GLOB ICONS_SRCS "data/icons/*.png") 0141 0142 option(ENABLE_PLUGIN_SSHMANAGER "Build the SSHManager plugin" ON) 0143 option(ENABLE_PLUGIN_QUICKCOMMANDS "Build the Quick Commands plugin" ON) 0144 0145 add_subdirectory( src ) 0146 add_subdirectory( data ) 0147 add_subdirectory( desktop ) 0148 0149 if (NOT WIN32) 0150 add_subdirectory( kconf_update ) 0151 endif() 0152 0153 if (KF5DocTools_FOUND) 0154 add_subdirectory( doc/manual ) 0155 endif() 0156 0157 add_subdirectory( tools ) 0158 0159 # Conditionally install icons for Linux as they may not be provided by the user theme 0160 option(INSTALL_ICONS "Install icons" OFF) 0161 if (INSTALL_ICONS) 0162 include(ECMInstallIcons) 0163 ecm_install_icons( ICONS ${ICONS_SRCS} DESTINATION ${KDE_INSTALL_ICONDIR} ) 0164 endif() 0165 0166 ecm_qt_install_logging_categories( 0167 EXPORT KONSOLE 0168 FILE konsole.categories 0169 DESTINATION "${KDE_INSTALL_LOGGINGCATEGORIESDIR}" 0170 ) 0171 0172 ki18n_install( po ) 0173 if (KF5DocTools_FOUND) 0174 kdoctools_install( po ) 0175 endif() 0176 0177 if (ECM_VERSION VERSION_GREATER_EQUAL 5.101.0) 0178 install(FILES completions/konsole.zsh RENAME _konsole DESTINATION ${KDE_INSTALL_ZSHAUTOCOMPLETEDIR}) 0179 endif() 0180 0181 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) 0182 0183 # add clang-format target for all our real source files 0184 file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.c *.cpp *.h *.hpp) 0185 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES}) 0186 if (ECM_VERSION VERSION_GREATER_EQUAL 5.79.0) 0187 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT) 0188 endif()