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