From: Kai Pastor Date: Wed, 22 Mar 2023 20:50:59 +0000 (+0100) Subject: CMake: make config version 8 compatible with 7 X-Git-Tag: curl-8_1_0~304 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ffd787a71c8eb5f2fd9096c779d8da21682c017;p=thirdparty%2Fcurl.git CMake: make config version 8 compatible with 7 Reviewed-by: Jakub Zakrzewski Closes #10819 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 874cc4eea3..0ddfce9afe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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