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