]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
CMake: make config version 8 compatible with 7
authorKai Pastor <dg0yt@darc.de>
Wed, 22 Mar 2023 20:50:59 +0000 (21:50 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 24 Mar 2023 23:29:07 +0000 (00:29 +0100)
Reviewed-by: Jakub Zakrzewski
Closes #10819

CMakeLists.txt

index 874cc4eea3fc8d69f2c1c2c18042fa884cfb7871..0ddfce9afe27ecb8c66e3f193600f9e2b589e3cc 100644 (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