Warning, /frameworks/extra-cmake-modules/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 #=============================================================================
0002 # SPDX-FileCopyrightText: 2006-2013 Alex Neundorf <neundorf@kde.org>
0003 # SPDX-FileCopyrightText: 2014-2015 Alex Merry <alex.merry@kde.org>
0004 #
0005 # SPDX-License-Identifier: BSD-3-Clause
0006 #=============================================================================
0007 
0008 cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
0009 
0010 #
0011 # Preliminary setup
0012 #
0013 
0014 set(VERSION "5.97.0") # handled by release scripts
0015 
0016 if (POLICY CMP0048)
0017     cmake_policy(SET CMP0048 NEW)
0018     project(ECM
0019         VERSION "${VERSION}"
0020         LANGUAGES NONE
0021     )
0022 else()
0023     project(ECM NONE)
0024     include("${CMAKE_SOURCE_DIR}/modules/ECMSetupVersion.cmake")
0025     ecm_setup_version(
0026         "${VERSION}"
0027         VARIABLE_PREFIX ECM
0028     )
0029 endif()
0030 
0031 
0032 #
0033 # Includes
0034 #
0035 
0036 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
0037 
0038 include(FeatureSummary)
0039 
0040 
0041 #
0042 # Installation paths
0043 #
0044 
0045 set(SHARE_INSTALL_DIR share
0046     CACHE
0047     PATH
0048     "read-only architecture-independent data"
0049 )
0050 
0051 set(CMAKECONFIG_INSTALL_DIR       ${SHARE_INSTALL_DIR}/ECM/cmake/)
0052 
0053 set(FIND_MODULES_INSTALL_DIR      ${SHARE_INSTALL_DIR}/ECM/find-modules/)
0054 set(KDE_MODULES_INSTALL_DIR       ${SHARE_INSTALL_DIR}/ECM/kde-modules/)
0055 set(MODULES_INSTALL_DIR           ${SHARE_INSTALL_DIR}/ECM/modules/)
0056 set(TOOLCHAIN_MODULES_INSTALL_DIR ${SHARE_INSTALL_DIR}/ECM/toolchain/)
0057 
0058 set(DOC_INSTALL_DIR ${SHARE_INSTALL_DIR}/doc/ECM
0059     CACHE
0060     PATH
0061     "HTML and QtHelp documentation"
0062 )
0063 set(MAN_INSTALL_DIR ${SHARE_INSTALL_DIR}/man
0064     CACHE
0065     PATH
0066     "man pages"
0067 )
0068 
0069 
0070 #
0071 # Documentation
0072 #
0073 
0074 add_subdirectory(docs)
0075 
0076 
0077 #
0078 # Tests
0079 #
0080 
0081 option(BUILD_TESTING "Build automated tests." ON)
0082 add_feature_info(BUILD_TESTING BUILD_TESTING "Build automated tests.")
0083 if(BUILD_TESTING)
0084     enable_testing()
0085     add_subdirectory(tests)
0086 endif()
0087 
0088 
0089 #
0090 # Install modules
0091 #
0092 
0093 file(GLOB installModuleFiles ${CMAKE_SOURCE_DIR}/modules/*[^~])
0094 install(FILES ${installModuleFiles} DESTINATION ${MODULES_INSTALL_DIR})
0095 
0096 file(GLOB installTestModuleFiles ${CMAKE_SOURCE_DIR}/test-modules/*[^~])
0097 install(FILES ${installTestModuleFiles} DESTINATION ${SHARE_INSTALL_DIR}/ECM/test-modules)
0098 
0099 file(GLOB installKdeModuleFiles LIST_DIRECTORIES FALSE ${CMAKE_SOURCE_DIR}/kde-modules/*[^~])
0100 install(FILES ${installKdeModuleFiles} DESTINATION ${KDE_MODULES_INSTALL_DIR})
0101 # The scripts need to be executable
0102 file(GLOB installKDECommitHooks ${CMAKE_SOURCE_DIR}/kde-modules/kde-git-commit-hooks/*[^~])
0103 install(PROGRAMS ${installKDECommitHooks} DESTINATION ${KDE_MODULES_INSTALL_DIR}/kde-git-commit-hooks)
0104 
0105 file(GLOB installFindModuleFiles ${CMAKE_SOURCE_DIR}/find-modules/*.cmake ${CMAKE_SOURCE_DIR}/find-modules/*.py)
0106 install(FILES ${installFindModuleFiles} DESTINATION ${FIND_MODULES_INSTALL_DIR})
0107 
0108 file(GLOB installToolchainModuleFiles ${CMAKE_SOURCE_DIR}/toolchain/*[^~])
0109 install(FILES ${installToolchainModuleFiles} DESTINATION ${TOOLCHAIN_MODULES_INSTALL_DIR})
0110 
0111 
0112 #
0113 # Config.cmake file
0114 #
0115 
0116 include(CMakePackageConfigHelpers)
0117 
0118 configure_package_config_file(
0119     ECMConfig.cmake.in
0120     ${CMAKE_CURRENT_BINARY_DIR}/ECMConfig.cmake
0121     INSTALL_DESTINATION
0122         ${CMAKECONFIG_INSTALL_DIR}
0123     PATH_VARS
0124         FIND_MODULES_INSTALL_DIR
0125         KDE_MODULES_INSTALL_DIR
0126         MODULES_INSTALL_DIR
0127 )
0128 
0129 write_basic_package_version_file(
0130     ${CMAKE_CURRENT_BINARY_DIR}/ECMConfigVersion.cmake
0131     VERSION
0132         "${PROJECT_VERSION}"
0133     COMPATIBILITY
0134         AnyNewerVersion
0135 )
0136 
0137 install(
0138     FILES
0139         ${CMAKE_CURRENT_BINARY_DIR}/ECMConfig.cmake
0140         ${CMAKE_CURRENT_BINARY_DIR}/ECMConfigVersion.cmake
0141     DESTINATION
0142         ${CMAKECONFIG_INSTALL_DIR}
0143 )
0144 
0145 
0146 #
0147 # Packaging
0148 #
0149 
0150 set(CPACK_PACKAGE_NAME extra-cmake-modules)
0151 set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
0152 set(CPACK_SYSTEM_NAME "generic")
0153 set(CPACK_GENERATOR "TGZ")
0154 set(CPACK_SET_DESTDIR FALSE)
0155 
0156 include(CPack)
0157 
0158 
0159 #
0160 # Feature summary
0161 #
0162 
0163 feature_summary(
0164     FATAL_ON_MISSING_REQUIRED_PACKAGES
0165     WHAT ALL
0166 )