Warning, /network/kio-extras/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 cmake_minimum_required(VERSION 3.16)
0002 
0003 # KDE Applications Version, managed by release script
0004 set (RELEASE_SERVICE_VERSION_MAJOR "24")
0005 set (RELEASE_SERVICE_VERSION_MINOR "04")
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 project(kio-extras VERSION ${RELEASE_SERVICE_VERSION})
0009 
0010 set(QT_MIN_VERSION "6.5.0")
0011 set(KF_MIN_VERSION "5.246.0")
0012 
0013 find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
0014 set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${ECM_MODULE_PATH})
0015 
0016 set(CMAKE_CXX_STANDARD 20)
0017 set(CMAKE_CXX_STANDARD_REQUIRED ON)
0018 
0019 include(KDEInstallDirs)
0020 include(KDECMakeSettings)
0021 include(KDECompilerSettings NO_POLICY_SCOPE)
0022 include(KDEGitCommitHooks)
0023 
0024 include(ECMMarkNonGuiExecutable)
0025 include(ECMMarkAsTest)
0026 include(ECMOptionalAddSubdirectory)
0027 include(ECMQtDeclareLoggingCategory)
0028 include(ECMDeprecationSettings)
0029 include(CheckIncludeFile)
0030 include(CMakePushCheckState)
0031 include(CMakePackageConfigHelpers)
0032 include(FeatureSummary)
0033 
0034 find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS DBus Network Widgets Svg Core5Compat)
0035 
0036 find_package(Qt6Test ${QT_MIN_VERSION} CONFIG QUIET)
0037 set_package_properties(Qt6Test PROPERTIES
0038          PURPOSE "Required for tests"
0039          TYPE OPTIONAL
0040          )
0041 add_feature_info("Qt6Test" Qt6Test_FOUND "Required for building tests")
0042 if (NOT Qt6Test_FOUND)
0043     set(BUILD_TESTING OFF CACHE BOOL "Build the testing tree.")
0044 endif()
0045 
0046 find_package(QCoro6 REQUIRED COMPONENTS Core)
0047 qcoro_enable_coroutines()
0048 
0049 find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS
0050     Archive
0051     Config
0052     ConfigWidgets
0053     CoreAddons
0054     DBusAddons
0055     DocTools
0056     DNSSD
0057     I18n
0058     KIO
0059     Solid
0060     GuiAddons
0061     SyntaxHighlighting
0062     KCMUtils
0063     TextWidgets
0064 )
0065 
0066 include(KDEClangFormat)
0067 file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
0068 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
0069 
0070 if (NOT WIN32)
0071     option(BUILD_ACTIVITIES "Build recentlyused:/, activities:/ KIO workers and fileitem plugin." ON)
0072     if(BUILD_ACTIVITIES)
0073         find_package(Qt6Sql REQUIRED)
0074         find_package(PlasmaActivities REQUIRED)
0075         find_package(PlasmaActivitiesStats REQUIRED)
0076     endif()
0077 endif()
0078 
0079 find_package(Phonon4Qt6 4.6.60 NO_MODULE)
0080 set_package_properties(Phonon4Qt6 PROPERTIES
0081    DESCRIPTION "Qt-based audio library"
0082    PURPOSE "Required for the audio preview plugin"
0083    TYPE OPTIONAL)
0084 
0085 include_directories(${CMAKE_CURRENT_BINARY_DIR})
0086 
0087 if(NOT WIN32)
0088     # we need a version of samba which has already smbc_set_context(), Alex
0089     set(SAMBA_REQUIRE_SMBC_SET_CONTEXT TRUE)
0090     set(SAMBA_REQUIRE_SMBC_OPTION_SET TRUE)
0091     find_package(Samba)
0092     set_package_properties(Samba PROPERTIES DESCRIPTION "the SMB client library, a version with smbc_set_context() and smbc_option_set()"
0093                         URL "https://www.samba.org/"
0094                         TYPE OPTIONAL
0095                         PURPOSE "Needed to build the SMB KIO worker"
0096                         )
0097 endif()
0098 
0099 find_package(libssh 0.8.3 MODULE)
0100 set_package_properties(libssh PROPERTIES DESCRIPTION "the SSH library with SFTP support"
0101                        URL "https://www.libssh.org/"
0102                        TYPE OPTIONAL
0103                        PURPOSE "Needed to build the SFTP KIO worker"
0104                       )
0105 
0106 find_package(Libmtp 1.1.2)
0107 set_package_properties(Libmtp PROPERTIES
0108                        TYPE OPTIONAL
0109                        PURPOSE "Needed to build the MTP KIO worker"
0110                        )
0111 
0112 find_package(IMobileDevice)
0113 set_package_properties(IMobileDevice PROPERTIES
0114                        TYPE OPTIONAL
0115                        PURPOSE "Needed to build the AFC (Apple File Conduit) KIO worker"
0116                       )
0117 
0118 find_package(PList)
0119 set_package_properties(PList PROPERTIES
0120                        TYPE OPTIONAL
0121                        PURPOSE "Needed to build the AFC (Apple File Conduit) KIO worker"
0122                       )
0123 
0124 check_include_file(utime.h HAVE_UTIME_H)
0125 
0126 # ECM's KDECompilerSettings.cmake should take care of enabling supporting on
0127 # 32bit architectures.
0128 # Thorw a fatal error if off_t isn't >=64bit to ensure that large files are working
0129 # as expected.
0130 # BUG: 165449
0131 if(UNIX)
0132     check_cxx_source_compiles("
0133         #include <sys/types.h>
0134         /* Check that off_t can represent 2**63 - 1 correctly.
0135             We can't simply define LARGE_OFF_T to be 9223372036854775807,
0136             since some C++ compilers masquerading as C compilers
0137             incorrectly reject 9223372036854775807.  */
0138         #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
0139 
0140         int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1];
0141         int main() { return 0; }
0142     "
0143     OFFT_IS_64BIT)
0144 
0145     if(NOT OFFT_IS_64BIT)
0146         message(FATAL_ERROR "Large file support is not enabled.")
0147     endif()
0148 
0149     find_package(Gperf)
0150     set_package_properties(Gperf PROPERTIES TYPE OPTIONAL
0151                            PURPOSE "Needed to build the man KIO worker"
0152                            )
0153 
0154     find_package(TIRPC)
0155     set_package_properties(TIRPC PROPERTIES TYPE OPTIONAL
0156                            PURPOSE "Needed to build the NFS KIO worker"
0157                            )
0158 else()
0159     # FIXME: on windows we ignore support until trash gets integrated
0160 endif()
0161 
0162 ecm_set_disabled_deprecation_versions(
0163     QT 5.15.2
0164     KF 5.96
0165 )
0166 
0167 add_subdirectory(doc)
0168 add_subdirectory(kcms)
0169 
0170 if(BUILD_ACTIVITIES)
0171   add_subdirectory( activities )
0172   add_subdirectory( recentlyused )
0173 endif()
0174 add_subdirectory( filter )
0175 if(Phonon4Qt6_FOUND)
0176     add_subdirectory( kfileaudiopreview )
0177 endif()
0178 add_subdirectory( info )
0179 add_subdirectory( archive )
0180 if (NOT WIN32)
0181     # does not compile: fish.cpp(41): fatal error C1083: Cannot open include file: 'sys/resource.h': No such file or directory
0182     # Used for getting the resource limit for closing all child process FDs. Could be completely replaced by fcloseall() if available for Unix or _fcloseall() for Windows, either conditionally on Q_OS_type or using a configure test.
0183     add_subdirectory( fish )
0184 endif()
0185 add_subdirectory( thumbnail )
0186 add_subdirectory( docfilter )
0187 if (libssh_FOUND)
0188     add_subdirectory(sftp)
0189 endif ()
0190 add_subdirectory( filenamesearch )
0191 if (Libmtp_FOUND)
0192   add_subdirectory(mtp)
0193 endif()
0194 
0195 if(NOT WIN32)
0196    if(Gperf_FOUND)
0197      add_subdirectory( man )
0198    endif()
0199    if(TIRPC_FOUND)
0200      add_subdirectory( nfs )
0201    endif()
0202 endif()
0203 
0204 if(SAMBA_FOUND)
0205     add_subdirectory(smb)
0206 endif()
0207 
0208 if(IMobileDevice_FOUND AND PList_FOUND)
0209     add_subdirectory(afc)
0210 endif()
0211 
0212 configure_file (config-runtime.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-runtime.h )
0213 
0214 ecm_qt_install_logging_categories(
0215     EXPORT KIO_EXTRAS
0216     FILE kio-extras.categories
0217     DESTINATION "${KDE_INSTALL_LOGGINGCATEGORIESDIR}"
0218 )
0219 
0220 ki18n_install(po)
0221 kdoctools_install(po)
0222 
0223 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
0224 
0225 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)