mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 16:32:14 -06:00
FindICU: Fix component reporting logic
Components were incorrectly reported as found because `component_found` is set to a string containing the variable name which is a truethy value. Fix by simply merging the setter of `component_found` with the reporting setter instead of checking `component_found OR component_found_compat` which is overly verbose anyway.
This commit is contained in:
@@ -254,13 +254,6 @@ function(_ICU_FIND)
|
||||
set("${component_found}" ON)
|
||||
set("${component_found_compat}" ON)
|
||||
list(APPEND ICU_LIBRARY "${${component_cache}}")
|
||||
endif()
|
||||
mark_as_advanced("${component_found}")
|
||||
mark_as_advanced("${component_found_compat}")
|
||||
set("${component_cache}" "${${component_cache}}" PARENT_SCOPE)
|
||||
set("${component_found}" "${${component_found}}" PARENT_SCOPE)
|
||||
set("${component_found_compat}" "${${component_found_compat}}" PARENT_SCOPE)
|
||||
if(component_found OR component_found_compat)
|
||||
if (ICU_FIND_REQUIRED_${component})
|
||||
list(APPEND ICU_LIBS_FOUND "${component} (required): ${${component_cache}}")
|
||||
else()
|
||||
@@ -274,6 +267,11 @@ function(_ICU_FIND)
|
||||
list(APPEND ICU_LIBS_NOTFOUND "${component} (optional)")
|
||||
endif()
|
||||
endif()
|
||||
mark_as_advanced("${component_found}")
|
||||
mark_as_advanced("${component_found_compat}")
|
||||
set("${component_cache}" "${${component_cache}}" PARENT_SCOPE)
|
||||
set("${component_found}" "${${component_found}}" PARENT_SCOPE)
|
||||
set("${component_found_compat}" "${${component_found_compat}}" PARENT_SCOPE)
|
||||
endforeach()
|
||||
set(_ICU_REQUIRED_LIBS_FOUND "${ICU_REQUIRED_LIBS_FOUND}" PARENT_SCOPE)
|
||||
set(ICU_LIBRARY "${ICU_LIBRARY}" PARENT_SCOPE)
|
||||
|
||||
Reference in New Issue
Block a user