From d38f78299507c159b271149f98dd594532a98a0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20Do=CC=88rig?= Date: Fri, 9 Feb 2018 10:50:14 +0100 Subject: [PATCH] Ensure Catch2ConfigVersion.cmake is installed properly The old version would lead to error when Catch was installed as a subproject. The file would be written to the subproject's build directory and then would not be installed properly. --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cf7e5965..4bb365ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -445,9 +445,10 @@ install(EXPORT Catch2Config # install Catch2ConfigVersion.cmake file to handle versions in find_package include(CMakePackageConfigHelpers) -write_basic_package_version_file(Catch2ConfigVersion.cmake +write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/Catch2ConfigVersion.cmake" COMPATIBILITY SameMajorVersion) install(FILES - "${CMAKE_BINARY_DIR}/Catch2ConfigVersion.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/Catch2ConfigVersion.cmake" DESTINATION ${CATCH_CMAKE_CONFIG_DESTINATION})