1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 02:08:27 +08:00

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
This commit is contained in:
Roger Leigh
2020-10-31 10:43:56 +00:00
parent cc7052f594
commit 21cb588629

View File

@@ -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()