diff options
| author | Martin Hořeňovský | 2018-09-01 21:51:49 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2018-09-01 21:51:49 +0200 |
| commit | 646e1f608d37640d4f4e359cf6b7ff7d9c7bbcdd (patch) | |
| tree | 2225561f25bd7988b4e263f90ee9e3d00b364080 | |
| parent | 6f75acbfb551c87a84947b5ce9481ca9d00a33c7 (diff) | |
| download | catch3-646e1f608d37640d4f4e359cf6b7ff7d9c7bbcdd.tar.gz | |
Make Catch2ConfigVersion.cmake be generated as arch-independent
As it turns out, there is a fairly reasonable workaround available.
Closes #1368
| -rw-r--r-- | CMakeLists.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 21f52ff1..8156fdaf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,11 +125,22 @@ if (NOT_SUBPROJECT) ${CATCH_CMAKE_CONFIG_DESTINATION} ) + # By default, FooConfigVersion is tied to architecture that it was + # generated on. Because Catch2 is header-only, it is arch-independent + # and thus Catch2ConfigVersion should not be tied to the architecture + # it was generated on. + # + # CMake does not provide a direct customization point for this in + # `write_basic_package_version_file`, but it can be accomplished + # indirectly by temporarily undefining `CMAKE_SIZEOF_VOID_P`. + set(CATCH2_CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P}) + unset(CMAKE_SIZEOF_VOID_P) write_basic_package_version_file( "${CMAKE_CURRENT_BINARY_DIR}/Catch2ConfigVersion.cmake" COMPATIBILITY SameMajorVersion ) + set(CMAKE_SIZEOF_VOID_P ${CATCH2_CMAKE_SIZEOF_VOID_P}) install( DIRECTORY |