diff options
author | Alexander Grund <Flamefire@users.noreply.github.com> | 2022-06-30 17:36:53 (GMT) |
---|---|---|
committer | Alexander Grund <Flamefire@users.noreply.github.com> | 2022-06-30 17:36:53 (GMT) |
commit | 669b6a37f5ce5b0b6a2623b4acb5442784d93b43 (patch) | |
tree | eda4cd2a8224e812405b3b0b9fb88b18517110be | |
parent | 7375542615e0c1d3d09117eac3a9e201275da425 (diff) | |
download | CMake-669b6a37f5ce5b0b6a2623b4acb5442784d93b43.zip CMake-669b6a37f5ce5b0b6a2623b4acb5442784d93b43.tar.gz CMake-669b6a37f5ce5b0b6a2623b4acb5442784d93b43.tar.bz2 |
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.
-rw-r--r-- | Modules/FindICU.cmake | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Modules/FindICU.cmake b/Modules/FindICU.cmake index 91dcba5..b4f4d71 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) |