CMake: make config version 8 compatible with 7

Reviewed-by: Jakub Zakrzewski
Closes #10819
This commit is contained in:
Kai Pastor 2023-03-22 21:50:59 +01:00 committed by Daniel Stenberg
parent fe55a63c83
commit 2ffd787a71
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -1614,6 +1614,15 @@ write_basic_package_version_file(
VERSION ${CURL_VERSION}
COMPATIBILITY SameMajorVersion
)
file(READ "${version_config}" generated_version_config)
file(WRITE "${version_config}"
"if(NOT PACKAGE_FIND_VERSION_RANGE AND PACKAGE_FIND_VERSION_MAJOR STREQUAL \"7\")
# Version 8 satisfies version 7... requirements
set(PACKAGE_FIND_VERSION_MAJOR 8)
set(PACKAGE_FIND_VERSION_COUNT 1)
endif()
${generated_version_config}"
)
# Use:
# * TARGETS_EXPORT_NAME