cmake: use ARCH_INDEPENDENT versioning if available

This commit is contained in:
Sergiu Deitsch 2021-09-02 15:49:53 +02:00 committed by Rasmus Munk Larsen
parent 7bc90cee7d
commit e8beb4b990

View File

@ -592,6 +592,10 @@ configure_package_config_file (
NO_SET_AND_CHECK_MACRO # Eigen does not provide legacy style defines NO_SET_AND_CHECK_MACRO # Eigen does not provide legacy style defines
NO_CHECK_REQUIRED_COMPONENTS_MACRO # Eigen does not provide components NO_CHECK_REQUIRED_COMPONENTS_MACRO # Eigen does not provide components
) )
# NOTE Remove the first code path once the minimum required CMake version is
# bumped to 3.14 or above.
if (CMAKE_VERSION VERSION_LESS 3.14)
# Remove CMAKE_SIZEOF_VOID_P from Eigen3ConfigVersion.cmake since Eigen does # Remove CMAKE_SIZEOF_VOID_P from Eigen3ConfigVersion.cmake since Eigen does
# not depend on architecture specific settings or libraries. More # not depend on architecture specific settings or libraries. More
# specifically, an Eigen3Config.cmake generated from a 64 bit target can be # specifically, an Eigen3Config.cmake generated from a 64 bit target can be
@ -602,6 +606,12 @@ write_basic_package_version_file (Eigen3ConfigVersion.cmake
VERSION ${EIGEN_VERSION_NUMBER} VERSION ${EIGEN_VERSION_NUMBER}
COMPATIBILITY SameMajorVersion) COMPATIBILITY SameMajorVersion)
set (CMAKE_SIZEOF_VOID_P ${_Eigen3_CMAKE_SIZEOF_VOID_P}) set (CMAKE_SIZEOF_VOID_P ${_Eigen3_CMAKE_SIZEOF_VOID_P})
else (CMAKE_VERSION VERSION_LESS 3.14)
write_basic_package_version_file (Eigen3ConfigVersion.cmake
VERSION ${EIGEN_VERSION_NUMBER}
COMPATIBILITY SameMajorVersion
ARCH_INDEPENDENT)
endif (CMAKE_VERSION VERSION_LESS 3.14)
# The Eigen target will be located in the Eigen3 namespace. Other CMake # The Eigen target will be located in the Eigen3 namespace. Other CMake
# targets can refer to it using Eigen3::Eigen. # targets can refer to it using Eigen3::Eigen.