Warning, /frameworks/kdelibs4support/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.101.0") # handled by release scripts
0004 set(KF_DEP_VERSION "5.100.0") # handled by release scripts
0005 project(KDELibs4Support VERSION ${KF_VERSION})
0006 
0007 include(FeatureSummary)
0008 find_package(ECM 5.100.0  NO_MODULE)
0009 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules")
0010 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
0011 
0012 
0013 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules )
0014 
0015 include(KDEInstallDirs)
0016 include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
0017 include(KDECMakeSettings)
0018 
0019 include(GenerateExportHeader)
0020 include(CMakeFindFrameworks)
0021 
0022 set(REQUIRED_QT_VERSION 5.15.2)
0023 find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Network Widgets DBus Test Svg PrintSupport Designer)
0024 
0025 find_package(KF5Completion ${KF_DEP_VERSION} REQUIRED)
0026 find_package(KF5Config ${KF_DEP_VERSION} REQUIRED)
0027 find_package(KF5ConfigWidgets ${KF_DEP_VERSION} REQUIRED)
0028 find_package(KF5Crash ${KF_DEP_VERSION} REQUIRED)
0029 find_package(KF5DesignerPlugin ${KF_DEP_VERSION} REQUIRED)
0030 find_package(KF5GlobalAccel ${KF_DEP_VERSION} REQUIRED)
0031 find_package(KF5DocTools ${KF_DEP_VERSION} REQUIRED)
0032 find_package(KF5Emoticons ${KF_DEP_VERSION} REQUIRED)
0033 find_package(KF5GuiAddons ${KF_DEP_VERSION} REQUIRED)
0034 find_package(KF5I18n ${KF_DEP_VERSION} REQUIRED)
0035 find_package(KF5IconThemes ${KF_DEP_VERSION} REQUIRED)
0036 find_package(KF5KIO ${KF_DEP_VERSION} REQUIRED)
0037 find_package(KF5Notifications ${KF_DEP_VERSION} REQUIRED)
0038 find_package(KF5Parts ${KF_DEP_VERSION} REQUIRED)
0039 find_package(KF5Service ${KF_DEP_VERSION} REQUIRED)
0040 find_package(KF5TextWidgets ${KF_DEP_VERSION} REQUIRED)
0041 find_package(KF5UnitConversion ${KF_DEP_VERSION} REQUIRED)
0042 find_package(KF5WidgetsAddons ${KF_DEP_VERSION} REQUIRED)
0043 find_package(KF5WindowSystem ${KF_DEP_VERSION} REQUIRED)
0044 find_package(KF5XmlGui ${KF_DEP_VERSION} REQUIRED)
0045 find_package(KF5DBusAddons ${KF_DEP_VERSION} REQUIRED)
0046 find_package(KDED ${KF_DEP_VERSION} REQUIRED)
0047 find_package(KF5Auth ${KF_DEP_VERSION} REQUIRED)
0048 
0049 if(WIN32)
0050     find_package(KDEWin REQUIRED)
0051 endif()
0052 
0053 if (NOT APPLE AND NOT WIN32)
0054     option(WITH_X11 "Build with X11 integration and session management" ON)
0055     if(WITH_X11)
0056         find_package(X11 REQUIRED)
0057         set(HAVE_X11 1)
0058     endif()
0059 endif()
0060 if (HAVE_X11)
0061   add_feature_info("X11 Session Management (libSM)" X11_SM_FOUND "Support for session management in KApplication")
0062   find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED X11Extras)
0063   find_package(XCB REQUIRED COMPONENTS XCB)
0064 endif ()
0065 
0066 if (APPLE)
0067     cmake_find_frameworks(CoreFoundation)
0068 endif ()
0069 
0070 include(ECMSetupVersion)
0071 include(ECMMarkNonGuiExecutable)
0072 
0073 ecm_setup_version(PROJECT VARIABLE_PREFIX KDELIBS4SUPPORT
0074                                  VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kdelibs4support_version.h"
0075                                  PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5KDELibs4SupportConfigVersion.cmake"
0076                                  SOVERSION 5)
0077 
0078 # Remove default warning version from KDEFrameworkCompilerSettings, too much noise
0079 # instead avoid any deprecation warnings (to what Qt respects its own flag)
0080 # Setting QT_DISABLE_DEPRECATED_BEFORE & KF_DISABLE_DEPRECATED_BEFORE_AND_AT as below
0081 # defaults those DEPRECATED_WARNINGS_SINCE to the same version -> no warnings
0082 remove_definitions(
0083     -DQT_DEPRECATED_WARNINGS_SINCE=0x060000
0084     -DKF_DEPRECATED_WARNINGS_SINCE=0x060000
0085 )
0086 # remove definitions set by KDEFrameworkCompilerSettings which we fail to meet
0087 remove_definitions(-DQT_NO_KEYWORDS)
0088 remove_definitions(-DQT_NO_FOREACH)
0089 remove_definitions(-DQT_NO_CAST_FROM_ASCII)
0090 remove_definitions(-DQT_NO_CAST_FROM_BYTEARRAY)
0091 remove_definitions(-DQT_USE_QSTRINGBUILDER)
0092 # TODO: use QT_USE_QSTRINGBUILDER instead of deprecated & undocumented QT_USE_FAST_OPERATOR_PLUS
0093 add_definitions(-DQT_USE_FAST_OPERATOR_PLUS)
0094 # ideally we would support QT_NO_KEYWORDS, but at least we can do this
0095 add_definitions(-DQT_NO_SIGNALS_SLOTS_KEYWORDS)
0096 
0097 # QUrl
0098 add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
0099 
0100 add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0)
0101 
0102 # This one won't be needed when CMake 2.8.13 is depended on.
0103 add_definitions(
0104     -DKDELIBS4SUPPORT_DEPRECATED= # if KDELIBS4SUPPORT_DEPRECATED is already defined the other deprecated macros won't be defined
0105     -DKDELIBS4SUPPORT_DEPRECATED_NO_EXPORT=KDELIBS4SUPPORT_NO_EXPORT
0106     -DKDELIBS4SUPPORT_DEPRECATED_EXPORT=KDELIBS4SUPPORT_EXPORT
0107 )
0108 
0109 add_definitions(-DTRANSLATION_DOMAIN=\"kdelibs4support\")
0110 
0111 add_executable(kf5-config kde-config.cpp )
0112 ecm_mark_nongui_executable(kf5-config)
0113 
0114 target_link_libraries(kf5-config KF5::CoreAddons KF5::I18n KF5::ConfigCore KF5::KDELibs4Support)
0115 target_include_directories(kf5-config PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/../..")
0116 
0117 install(TARGETS kf5-config ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
0118 
0119 
0120 # create a Config.cmake and a ConfigVersion.cmake file and install them
0121 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5KDELibs4Support")
0122 
0123 include(CMakePackageConfigHelpers)
0124 
0125 configure_package_config_file(
0126     "${CMAKE_CURRENT_SOURCE_DIR}/KF5KDELibs4SupportConfig.cmake.in"
0127     "${CMAKE_CURRENT_BINARY_DIR}/KF5KDELibs4SupportConfig.cmake"
0128     PATH_VARS KDE_INSTALL_DBUSINTERFACEDIR
0129     INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
0130 )
0131 
0132 install(FILES  "${CMAKE_CURRENT_BINARY_DIR}/KF5KDELibs4SupportConfig.cmake"
0133                "${CMAKE_CURRENT_BINARY_DIR}/KF5KDELibs4SupportConfigVersion.cmake"
0134         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0135         COMPONENT Devel)
0136 
0137 install(EXPORT KF5KDELibs4SupportTargets
0138         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0139         FILE KF5KDELibs4SupportTargets.cmake
0140         NAMESPACE KF5::)
0141 
0142 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kdelibs4support_version.h
0143         DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KDELibs4Support
0144         COMPONENT Devel)
0145 
0146 
0147 
0148 #
0149 # Compatibility file
0150 #
0151 set(CMAKECONFIG_COMPAT_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5KDE4Support")
0152 if(BUILD_SHARED_LIBS)
0153     set(KDELibs4Support_LIB_TYPE SHARED)
0154 else()
0155     set(KDELibs4Support_LIB_TYPE STATIC)
0156 endif()
0157 configure_package_config_file(
0158     "${CMAKE_CURRENT_SOURCE_DIR}/KF5KDE4SupportConfig.cmake.in"
0159     "${CMAKE_CURRENT_BINARY_DIR}/KF5KDE4SupportConfig.cmake"
0160     INSTALL_DESTINATION "${CMAKECONFIG_COMPAT_INSTALL_DIR}"
0161 )
0162 write_basic_package_version_file(
0163     "${CMAKE_CURRENT_BINARY_DIR}/KF5KDE4SupportConfigVersion.cmake"
0164     VERSION ${KF_VERSION}
0165     COMPATIBILITY AnyNewerVersion
0166 )
0167 install(
0168     FILES
0169         "${CMAKE_CURRENT_BINARY_DIR}/KF5KDE4SupportConfig.cmake"
0170         "${CMAKE_CURRENT_BINARY_DIR}/KF5KDE4SupportConfigVersion.cmake"
0171     DESTINATION "${CMAKECONFIG_COMPAT_INSTALL_DIR}"
0172     COMPONENT Devel
0173 )
0174 
0175 
0176 
0177 ki18n_install(po)
0178 kdoctools_install(po)
0179 add_subdirectory(cmake)
0180 add_subdirectory(data)
0181 add_subdirectory(docs)
0182 add_subdirectory(src)
0183 
0184 if (BUILD_TESTING)
0185     add_subdirectory(autotests)
0186     add_subdirectory(tests)
0187 endif ()
0188 
0189 
0190 set (KDE_VERSION_MAJOR 4)
0191 set (KDE_VERSION_MINOR 90)
0192 set (KDE_VERSION_RELEASE 00)
0193 set (KDE_VERSION "${KDE_VERSION_MAJOR}.${KDE_VERSION_MINOR}.${KDE_VERSION_RELEASE}" )
0194 # For git master, use this:
0195 set (KDE_VERSION_STRING "${KDE_VERSION} (KDE Frameworks >= 20121130)")
0196 # For a stable release, use this:
0197 #set (KDE_VERSION_STRING "${KDE_VERSION}")
0198 
0199 include(CreateKDELibsDependenciesFile.cmake)
0200 set(CMAKECONFIG_INSTALL_DIR ${KDE_INSTALL_LIBDIR}/cmake/KDELibs4)
0201 
0202 # Used in configure_file() and install(EXPORT)
0203 set(KDE4_TARGET_PREFIX KDE4__)
0204 
0205 ################# install files #################
0206 
0207 install( FILES ${CMAKE_CURRENT_BINARY_DIR}/KDELibsDependencies.cmake
0208                ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/kde4_cmake_uninstall.cmake.in
0209                ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/Win32.Manifest.in
0210          DESTINATION ${CMAKECONFIG_INSTALL_DIR} COMPONENT Devel)
0211 
0212 # run a script before installing the exports files which deletes previously installed
0213 # configuration specific export files KDELibs4(Library|Tools)Targets-<config>.cmake
0214 # if the main exports file KDELibs4(Library|Tools)Targets.cmake has changed. This makes sure
0215 # that this main file doesn't include older and different configuration specific exports files,
0216 # which might have a different set of targets or targets with different names.
0217 # The code for installing the exports files will soon go into a macro. Alex
0218 install(CODE "set(EXPORT_FILES KDELibs4LibraryTargets.cmake)"
0219         CODE "set(EXPORT_INSTALL_DIR \"${CMAKECONFIG_INSTALL_DIR}\")"
0220         SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/check_installed_exports_file.cmake" )
0221 install(EXPORT KF5KDELibs4SupportTargets
0222         DESTINATION ${CMAKECONFIG_INSTALL_DIR}
0223         NAMESPACE ${KDE4_TARGET_PREFIX}
0224         FILE KF5KDELibs4LibraryTargets.cmake
0225         COMPONENT Devel)
0226 
0227 feature_summary(WHAT ALL   FATAL_ON_MISSING_REQUIRED_PACKAGES)
0228 
0229 if (HAVE_X11 AND NOT X11_SM_FOUND)
0230   message(FATAL_ERROR "The X11 Session Management library (libSM) is required when building on X11.")
0231 endif()