summaryrefslogtreecommitdiff
path: root/Modules/FindICU.cmake
diff options
context:
space:
mode:
authorAlexander Grund <Flamefire@users.noreply.github.com>2022-06-30 19:36:53 +0200
committerAlexander Grund <Flamefire@users.noreply.github.com>2022-06-30 19:36:53 +0200
commit669b6a37f5ce5b0b6a2623b4acb5442784d93b43 (patch)
treeeda4cd2a8224e812405b3b0b9fb88b18517110be /Modules/FindICU.cmake
parent7375542615e0c1d3d09117eac3a9e201275da425 (diff)
downloadcmake-669b6a37f5ce5b0b6a2623b4acb5442784d93b43.tar.gz
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.
Diffstat (limited to 'Modules/FindICU.cmake')
-rw-r--r--Modules/FindICU.cmake12
1 files changed, 5 insertions, 7 deletions
diff --git a/Modules/FindICU.cmake b/Modules/FindICU.cmake
index 91dcba5a8f..b4f4d7134e 100644
--- a/Modules/FindICU.cmake
+++ b/Modules/FindICU.cmake
@@ -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)