]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: set found status to OFF when not found (for compression deps)
authorJoshua Vandaƫle <joshua@vandaele.software>
Thu, 1 Jan 2026 21:54:14 +0000 (22:54 +0100)
committerViktor Szakats <commit@vsz.me>
Fri, 2 Jan 2026 00:29:47 +0000 (01:29 +0100)
This fixes curl using libraries if `CURL_{BROTLI|ZLIB|ZSTD}` is set to
`OFF` but the library was found in a parent project that includes curl.

Closes #20147

CMake/Macros.cmake

index 80173fb03bf03a717f639499143d389e004cbc24..ca6330184dce87bbf1754d6b46bd70019bf2ba03 100644 (file)
@@ -74,6 +74,10 @@ macro(curl_dependency_option _option_name _find_name _desc_name)
     find_package(${_find_name})
   elseif(${_option_name})
     find_package(${_find_name} REQUIRED)
+  else()
+    string(TOUPPER "${_find_name}" _find_name_upper)
+    set(${_find_name}_FOUND OFF)  # cmake-lint: disable=C0103
+    set(${_find_name_upper}_FOUND OFF)  # cmake-lint: disable=C0103
   endif()
 endmacro()