Warning, /frameworks/kio/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(KIO VERSION ${KF_VERSION}) 0007 0008 include(FeatureSummary) 0009 find_package(ECM 5.115.0 NO_MODULE) 0010 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules") 0011 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) 0012 0013 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake ) 0014 0015 include(KDEInstallDirs) 0016 include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) 0017 include(KDECMakeSettings) 0018 include(KDEGitCommitHooks) 0019 include(KDEPackageAppTemplates) 0020 0021 include(ECMGenerateExportHeader) 0022 include(ECMMarkAsTest) 0023 include(ECMSetupVersion) 0024 include(ECMGenerateHeaders) 0025 include(ECMAddQch) 0026 include(ECMMarkNonGuiExecutable) 0027 include(ECMQtDeclareLoggingCategory) 0028 include(ECMSourceVersionControl) 0029 include(ECMDeprecationSettings) 0030 0031 ecm_setup_version( 0032 PROJECT 0033 VARIABLE_PREFIX KIO 0034 VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/src/kio_version.h" 0035 PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5KIOConfigVersion.cmake" 0036 SOVERSION 5) 0037 0038 set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].") 0039 0040 option(KIOCORE_ONLY "Only compile KIOCore, not KIOWidgets or anything that depends on it. This will disable support for cookies and passwordhandling (prompting and storing)." OFF) 0041 0042 # Enable state assertion by default on Jenkins and from-git builds. 0043 # This option should eventually be dropped and always be enabled. 0044 set(ASSERT_SLAVE_STATES_DEFAULT OFF) 0045 if(DEFINED ENV{JENKINS_SERVER_COOKIE} OR ECM_SOURCE_UNDER_VERSION_CONTROL) 0046 set(ASSERT_SLAVE_STATES_DEFAULT ON) 0047 endif() 0048 option(KIO_ASSERT_SLAVE_STATES 0049 "Used to control whether worker state assertions are enabled. When not enabled only warnings are generated." 0050 ${ASSERT_SLAVE_STATES_DEFAULT}) 0051 0052 # TODO KF6: remove 0053 option(KIO_NO_PUBLIC_QTCONCURRENT "Privatize QtConcurrent linking, so KIO does not provide the target to revdeps.") 0054 0055 option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF) 0056 add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)") 0057 0058 option(BUILD_DESIGNERPLUGIN "Build plugin for Qt Designer" ON) 0059 add_feature_info(DESIGNERPLUGIN ${BUILD_DESIGNERPLUGIN} "Build plugin for Qt Designer") 0060 0061 option(USE_FTPD_WSGIDAV_UNITTEST "Use ftpd Ruby Gem (for ftptest) and wsgidav Python module (for webdavtest) in unittests. Note that this is a temporary option that will be removed when distros add those packages in their repos." OFF) 0062 0063 option(KF6_COMPAT_BUILD "Don't install files that conflict with KF6" OFF) 0064 0065 find_package(KF5Archive ${KF_DEP_VERSION} REQUIRED) 0066 find_package(KF5Config ${KF_DEP_VERSION} REQUIRED) 0067 find_package(KF5CoreAddons ${KF_DEP_VERSION} REQUIRED) 0068 find_package(KF5I18n ${KF_DEP_VERSION} REQUIRED) 0069 find_package(KF5Service ${KF_DEP_VERSION} REQUIRED) 0070 find_package(KF5DocTools ${KF_DEP_VERSION}) 0071 find_package(KF5Solid ${KF_DEP_VERSION} REQUIRED) # for kio_trash 0072 if (NOT ANDROID) 0073 find_package(KF5Crash ${KF_DEP_VERSION} REQUIRED) 0074 find_package(KF5DBusAddons ${KF_DEP_VERSION} REQUIRED) 0075 endif() 0076 0077 if (NOT KIOCORE_ONLY) 0078 find_package(KF5Bookmarks ${KF_DEP_VERSION} REQUIRED) 0079 find_package(KF5Completion ${KF_DEP_VERSION} REQUIRED) 0080 find_package(KF5ConfigWidgets ${KF_DEP_VERSION} REQUIRED) 0081 find_package(KF5GuiAddons ${KF_DEP_VERSION} REQUIRED) 0082 find_package(KF5IconThemes ${KF_DEP_VERSION} REQUIRED) 0083 find_package(KF5ItemViews ${KF_DEP_VERSION} REQUIRED) 0084 find_package(KF5JobWidgets ${KF_DEP_VERSION} REQUIRED) 0085 find_package(KF5WidgetsAddons ${KF_DEP_VERSION} REQUIRED) 0086 find_package(KF5WindowSystem ${KF_DEP_VERSION} REQUIRED) 0087 0088 find_package(KDED) 0089 set_package_properties(KDED PROPERTIES DESCRIPTION "Daemon providing session services" 0090 TYPE RUNTIME 0091 PURPOSE "KDED is used at runtime for proxy management and cookie storage" 0092 ) 0093 0094 find_package(SwitcherooControl) 0095 set_package_properties(SwitcherooControl PROPERTIES 0096 TYPE RUNTIME 0097 PURPOSE "Hybrid GPU support" 0098 ) 0099 0100 endif() 0101 0102 if (UNIX AND NOT ANDROID) 0103 find_package(KF5Auth ${KF_DEP_VERSION} REQUIRED) 0104 endif() 0105 0106 # tell what is missing without doctools 0107 set_package_properties(KF5DocTools PROPERTIES DESCRIPTION "Provides tools to generate documentation in various format from DocBook files" 0108 TYPE OPTIONAL 0109 PURPOSE "Required to build help KIO worker and documentation" 0110 ) 0111 0112 set(REQUIRED_QT_VERSION 5.15.2) 0113 find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} CONFIG REQUIRED Widgets Network Concurrent Xml Test) 0114 if (NOT ANDROID) 0115 find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} CONFIG REQUIRED DBus) 0116 endif() 0117 0118 set(_qt6_core_compat_found FALSE) 0119 if (QT_MAJOR_VERSION STREQUAL "6") 0120 find_package(Qt6Core5Compat ${REQUIRED_QT_VERSION} REQUIRED) # QTextCodec 0121 set(_qt6_core_compat_found ${Qt6Core5Compat_FOUND}) 0122 endif() 0123 0124 find_package(GSSAPI) 0125 set_package_properties(GSSAPI PROPERTIES DESCRIPTION "Allows KIO to make use of certain HTTP authentication services" 0126 URL "https://web.mit.edu/kerberos/www/" 0127 TYPE OPTIONAL 0128 PURPOSE "A MIT or HEIMDAL flavor of GSSAPI can be used" 0129 ) 0130 0131 if (NOT APPLE AND NOT WIN32 AND NOT ANDROID) 0132 option(WITH_X11 "Build with X11 integration" ON) 0133 if(WITH_X11) 0134 if (QT_MAJOR_VERSION STREQUAL "5") 0135 find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED X11Extras) 0136 else() 0137 # qtx11extras_p.h is in Qt6Gui, which is implied by the find_package(QtWidgets) above 0138 endif() 0139 endif() 0140 set(HAVE_X11 ${WITH_X11}) 0141 endif() 0142 0143 find_package(ACL) 0144 set(HAVE_LIBACL ${ACL_FOUND}) 0145 set(HAVE_POSIX_ACL ${ACL_FOUND}) 0146 set_package_properties(ACL PROPERTIES DESCRIPTION "LibACL" 0147 URL "ftp://oss.sgi.com/projects/xfs/cmd_tars" 0148 TYPE RECOMMENDED 0149 PURPOSE "Support for manipulating access control lists") 0150 0151 # Used by KMountPoint 0152 if (CMAKE_SYSTEM_NAME MATCHES "Linux") 0153 find_package(LibMount REQUIRED) 0154 set(HAVE_LIB_MOUNT ${LibMount_FOUND}) 0155 endif() 0156 0157 if (ANDROID) 0158 # used to mark code that is just stubbed out on Android for now 0159 # and that would still need a decision on how to deal with that 0160 add_definitions(-DKIO_ANDROID_STUB) 0161 endif() 0162 0163 ecm_set_disabled_deprecation_versions( 0164 QT 5.15.2 0165 KF 5.97 0166 KCOMPLETION 5.65 # we use KPixmapProvider in public API 0167 KSERVICE 5.81 # we use KMimeTypeTrader in KFileItemActions 0168 KCOREADDONS 5.85 # KService::createInstance uses deprecated parts of KCoreAddons in the header 0169 KCONFIGCORE 5.81 # we use KDesktopFile::readDevice 0170 KWIDGETSADDONS 5.96 # we use KMessageDialog::Sorry 0171 ) 0172 0173 add_definitions(-DTRANSLATION_DOMAIN=\"kio5\") 0174 ki18n_install(po) 0175 0176 if (KF5DocTools_FOUND) 0177 kdoctools_install(po) 0178 endif() 0179 0180 if (KF5DocTools_FOUND) 0181 add_subdirectory(docs) 0182 endif() 0183 0184 include(CheckLibraryExists) 0185 add_subdirectory(src) 0186 0187 if(BUILD_TESTING) 0188 add_subdirectory(autotests) 0189 if (NOT KIOCORE_ONLY) 0190 add_subdirectory(tests) 0191 endif() 0192 endif() 0193 0194 add_subdirectory(kconf_update) 0195 add_subdirectory(templates) 0196 0197 # create a Config.cmake and a ConfigVersion.cmake file and install them 0198 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5KIO") 0199 0200 if (BUILD_QCH) 0201 ecm_install_qch_export( 0202 TARGETS KF5KIO_QCH 0203 FILE KF5KIOQchTargets.cmake 0204 DESTINATION "${CMAKECONFIG_INSTALL_DIR}" 0205 COMPONENT Devel 0206 ) 0207 set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF5KIOQchTargets.cmake\")") 0208 endif() 0209 0210 include(CMakePackageConfigHelpers) 0211 0212 configure_package_config_file( 0213 "${CMAKE_CURRENT_SOURCE_DIR}/KF5KIOConfig.cmake.in" 0214 "${CMAKE_CURRENT_BINARY_DIR}/KF5KIOConfig.cmake" 0215 PATH_VARS KDE_INSTALL_DBUSINTERFACEDIR 0216 INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} 0217 ) 0218 0219 install(FILES 0220 "${CMAKE_CURRENT_BINARY_DIR}/KF5KIOConfig.cmake" 0221 "${CMAKE_CURRENT_BINARY_DIR}/KF5KIOConfigVersion.cmake" 0222 DESTINATION "${CMAKECONFIG_INSTALL_DIR}" 0223 COMPONENT Devel 0224 ) 0225 0226 install(EXPORT KF5KIOTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5KIOTargets.cmake NAMESPACE KF5:: ) 0227 0228 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/src/kio_version.h 0229 DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KIO COMPONENT Devel) 0230 0231 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) 0232 0233 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)