diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt index 8431f0a..52288f4 100644 --- a/config/CMakeLists.txt +++ b/config/CMakeLists.txt @@ -47,3 +47,22 @@ install( "${CMAKE_CURRENT_SOURCE_DIR}/modules/" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" ) + +include(CMakePackageConfigHelpers) +configure_package_config_file( + "${CMAKE_CURRENT_SOURCE_DIR}/config.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" + INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" +) +write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake" + VERSION "${PROJECT_VERSION}" + COMPATIBILITY SameMinorVersion +) +install( + FILES + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" +) + diff --git a/config/modules/Findmctc-lib.cmake b/config/modules/Findmctc-lib.cmake index b1ab56d..e1adb08 100644 --- a/config/modules/Findmctc-lib.cmake +++ b/config/modules/Findmctc-lib.cmake @@ -27,9 +27,9 @@ if(NOT DEFINED "${_pkg}_FIND_METHOD") set("_${_pkg}_FIND_METHOD") endif() -include("${CMAKE_CURRENT_LIST_DIR}/xtb-utils.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/cpcm-x-utils.cmake") -xtb_find_package("${_lib}" "${${_pkg}_FIND_METHOD}" "${_url}") +cpcmx_find_package("${_lib}" "${${_pkg}_FIND_METHOD}" "${_url}") if(DEFINED "_${_pkg}_FIND_METHOD") unset("${_pkg}_FIND_METHOD") diff --git a/config/modules/Findnumsa.cmake b/config/modules/Findnumsa.cmake index a03a24b..48a0d00 100644 --- a/config/modules/Findnumsa.cmake +++ b/config/modules/Findnumsa.cmake @@ -78,9 +78,9 @@ if(NOT DEFINED "${_pkg}_FIND_METHOD") set("_${_pkg}_FIND_METHOD") endif() -include("${CMAKE_CURRENT_LIST_DIR}/xtb-utils.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/cpcm-x-utils.cmake") -xtb_find_package("${_lib}" "${${_pkg}_FIND_METHOD}" "${_url}") +cpcmx_find_package("${_lib}" "${${_pkg}_FIND_METHOD}" "${_url}") if(DEFINED "_${_pkg}_FIND_METHOD") unset("${_pkg}_FIND_METHOD") diff --git a/config/modules/Findtblite.cmake b/config/modules/Findtblite.cmake index b295f45..ccdcbc7 100644 --- a/config/modules/Findtblite.cmake +++ b/config/modules/Findtblite.cmake @@ -27,9 +27,9 @@ if(NOT DEFINED "${_pkg}_FIND_METHOD") set("_${_pkg}_FIND_METHOD") endif() -include("${CMAKE_CURRENT_LIST_DIR}/xtb-utils.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/cpcm-x-utils.cmake") -xtb_find_package("${_lib}" "${${_pkg}_FIND_METHOD}" "${_url}") +cpcmx_find_package("${_lib}" "${${_pkg}_FIND_METHOD}" "${_url}") if(DEFINED "_${_pkg}_FIND_METHOD") unset("${_pkg}_FIND_METHOD") diff --git a/config/modules/Findtest-drive.cmake b/config/modules/Findtest-drive.cmake index 9a631da..bac66bf 100644 --- a/config/modules/Findtest-drive.cmake +++ b/config/modules/Findtest-drive.cmake @@ -78,9 +78,9 @@ if(NOT DEFINED "${_pkg}_FIND_METHOD") set("_${_pkg}_FIND_METHOD") endif() -include("${CMAKE_CURRENT_LIST_DIR}/xtb-utils.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/cpcm-x-utils.cmake") -xtb_find_package("${_lib}" "${${_pkg}_FIND_METHOD}" "${_url}") +cpcmx_find_package("${_lib}" "${${_pkg}_FIND_METHOD}" "${_url}") if(DEFINED "_${_pkg}_FIND_METHOD") unset("${_pkg}_FIND_METHOD") diff --git a/config/modules/Findtoml-f.cmake b/config/modules/Findtoml-f.cmake index 5874923..9d273f2 100644 --- a/config/modules/Findtoml-f.cmake +++ b/config/modules/Findtoml-f.cmake @@ -78,9 +78,9 @@ if(NOT DEFINED "${_pkg}_FIND_METHOD") set("_${_pkg}_FIND_METHOD") endif() -include("${CMAKE_CURRENT_LIST_DIR}/xtb-utils.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/cpcm-x-utils.cmake") -xtb_find_package("${_lib}" "${${_pkg}_FIND_METHOD}" "${_url}") +cpcmx_find_package("${_lib}" "${${_pkg}_FIND_METHOD}" "${_url}") if(DEFINED "_${_pkg}_FIND_METHOD") unset("${_pkg}_FIND_METHOD") diff --git a/config/modules/xtb-utils.cmake b/config/modules/cpcm-x-utils.cmake similarity index 99% rename from config/modules/xtb-utils.cmake rename to config/modules/cpcm-x-utils.cmake index d69980f..91ed3b4 100644 --- a/config/modules/xtb-utils.cmake +++ b/config/modules/cpcm-x-utils.cmake @@ -16,7 +16,7 @@ # Handling of subproject dependencies macro( - "xtb_find_package" + "cpcmx_find_package" package methods url