Skip to content
This repository was archived by the owner on Apr 30, 2025. It is now read-only.

Commit abaf875

Browse files
authored
Fix FindBrotli when no Brotli installed (yhirose#598)
Woops. Ref yhirose#582 (comment)
1 parent 5f76cb0 commit abaf875

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmake/FindBrotli.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,17 @@ foreach(_target_name "common" "decoder" "encoder")
166166
elseif(Brotli_FIND_REQUIRED_${_target_name})
167167
# Only bother with an error/failure if they actually required the lib.
168168
brotli_err_msg("Failed to find Brotli's ${_target_name} library. Try manually defining \"Brotli_${_target_name}\" to its path on your system.")
169+
# If the compnent was required but not found, you set XXX_FOUND to false to signify failure to find component(s)
170+
# This is used in find_package_handle_standard_args's HANDLE_COMPONENTS (I think)
171+
set(Brotli_FOUND FALSE)
169172
endif()
170173
endforeach()
171174

172175
include(FindPackageHandleStandardArgs)
173176
find_package_handle_standard_args(Brotli
174177
FOUND_VAR Brotli_FOUND
175178
REQUIRED_VARS ${_brotli_req_vars}
179+
HANDLE_COMPONENTS
176180
)
177181

178182
if(Brotli_FOUND)

0 commit comments

Comments
 (0)