diff --git a/CMakeLists.txt b/CMakeLists.txt index 30474c5..a9548f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -401,8 +401,17 @@ configure_package_config_file( INSTALL_DESTINATION ${akerror_install_cmakedir} ) +# The SOVERSION is the project major version, so packages with the same major +# are ABI-compatible and a different major must be rejected. +write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/akerrorConfigVersion.cmake" + VERSION ${PROJECT_VERSION} + COMPATIBILITY SameMajorVersion +) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/akerrorConfig.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/akerrorConfigVersion.cmake" DESTINATION ${akerror_install_cmakedir} )