diff options
author | Roger Leigh <rleigh@codelibre.net> | 2020-10-31 10:43:56 (GMT) |
---|---|---|
committer | Roger Leigh <rleigh@codelibre.net> | 2020-10-31 11:06:41 (GMT) |
commit | 21cb5886296135dbf14be97e43aee19b846cd27f (patch) | |
tree | f75d96a340781068ae23538691ca3061432bb2e4 /Modules | |
parent | cc7052f5948441a6172b0d7cfc00fcea96459f77 (diff) | |
download | CMake-21cb5886296135dbf14be97e43aee19b846cd27f.zip CMake-21cb5886296135dbf14be97e43aee19b846cd27f.tar.gz CMake-21cb5886296135dbf14be97e43aee19b846cd27f.tar.bz2 |
FindICU: Correct variable names to match documentation
* Add "ICU_" suffix to all _FOUND variables
* Ensure cache variables can also be used with correct
ICU_ suffix and compatibility name
* Improve ICU_DEBUG messages to verify compatibility and
corrected variable names are set to the correct values
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindICU.cmake | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/Modules/FindICU.cmake b/Modules/FindICU.cmake index c8b3e1f..53cf15c 100644 --- a/Modules/FindICU.cmake +++ b/Modules/FindICU.cmake @@ -188,7 +188,8 @@ function(_ICU_FIND) set(component_cache "ICU_${component_upcase}_LIBRARY") set(component_cache_release "${component_cache}_RELEASE") set(component_cache_debug "${component_cache}_DEBUG") - set(component_found "${component_upcase}_FOUND") + set(component_found "ICU_${component_upcase}_FOUND") + set(component_found_compat "${component_upcase}_FOUND") set(component_libnames "icu${component}") set(component_debug_libnames "icu${component}d") @@ -250,12 +251,15 @@ function(_ICU_FIND) mark_as_advanced("${component_cache_release}" "${component_cache_debug}") if(${component_cache}) 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) - if(${component_found}) + 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)") else() @@ -346,7 +350,7 @@ if(ICU_FOUND) set(_ICU_component_cache_release "ICU_${_ICU_component_upcase}_LIBRARY_RELEASE") set(_ICU_component_cache_debug "ICU_${_ICU_component_upcase}_LIBRARY_DEBUG") set(_ICU_component_lib "ICU_${_ICU_component_upcase}_LIBRARIES") - set(_ICU_component_found "${_ICU_component_upcase}_FOUND") + set(_ICU_component_found "ICU_${_ICU_component_upcase}_FOUND") set(_ICU_imported_target "ICU::${_ICU_component}") if(${_ICU_component_found}) set("${_ICU_component_lib}" "${${_ICU_component_cache}}") @@ -400,7 +404,7 @@ if(ICU_DEBUG) foreach(program IN LISTS icu_programs) string(TOUPPER "${program}" program_upcase) set(program_lib "ICU_${program_upcase}_EXECUTABLE") - message(STATUS "${program} program: ${${program_lib}}") + message(STATUS "${program} program: ${program_lib}=${${program_lib}}") unset(program_upcase) unset(program_lib) endforeach() @@ -409,7 +413,7 @@ if(ICU_DEBUG) string(TOUPPER "${data}" data_upcase) string(REPLACE "." "_" data_upcase "${data_upcase}") set(data_lib "ICU_${data_upcase}") - message(STATUS "${data} data: ${${data_lib}}") + message(STATUS "${data} data: ${data_lib}=${${data_lib}}") unset(data_upcase) unset(data_lib) endforeach() @@ -417,12 +421,15 @@ if(ICU_DEBUG) foreach(component IN LISTS ICU_FIND_COMPONENTS) string(TOUPPER "${component}" component_upcase) set(component_lib "ICU_${component_upcase}_LIBRARIES") - set(component_found "${component_upcase}_FOUND") - message(STATUS "${component} library found: ${${component_found}}") - message(STATUS "${component} library: ${${component_lib}}") + set(component_found "ICU_${component_upcase}_FOUND") + set(component_found_compat "${component_upcase}_FOUND") + message(STATUS "${component} library found: ${component_found}=${${component_found}}") + message(STATUS "${component} library found (compat name): ${component_found_compat}=${${component_found_compat}}") + message(STATUS "${component} library: ${component_lib}=${${component_lib}}") unset(component_upcase) unset(component_lib) unset(component_found) + unset(component_found_compat) endforeach() message(STATUS "----------------") endif() |