FindCURL: Set CURL_VERSION_STRING when curl is found as a package

FindCURL, when found as `curl-config.cmake`, will fill `CURL_VERSION`
instead of `CURL_VERSION_STRING` variable.  It may break some cases
when user is relying on correct value of the latter variable, and
as an example, already breaks `CMakeOnly.AllFindModules` test.
This commit is contained in:
makise-homura
2022-06-23 23:38:40 +03:00
committed by Brad King
parent 31cbe200f3
commit 886ba0b1d6

View File

@@ -72,6 +72,8 @@ if(NOT CURL_NO_CURL_CMAKE)
# can print what we found and return.
if(CURL_FOUND)
find_package_handle_standard_args(CURL HANDLE_COMPONENTS CONFIG_MODE)
# The upstream curl package sets CURL_VERSION, not CURL_VERSION_STRING.
set(CURL_VERSION_STRING "${CURL_VERSION}")
return()
endif()
endif()