diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-12-13 16:28:18 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2023-12-13 16:28:18 (GMT) |
commit | d892dedf2253127c85a443330630c6a9704c5e28 (patch) | |
tree | d8d98998667ab52dc09864f21280f2e9b8be6a45 /Modules | |
parent | ef6aec22a1c0d781754648f0dede0ec35e43730a (diff) | |
download | CMake-d892dedf2253127c85a443330630c6a9704c5e28.zip CMake-d892dedf2253127c85a443330630c6a9704c5e28.tar.gz CMake-d892dedf2253127c85a443330630c6a9704c5e28.tar.bz2 |
FindFreetype: always find the config module quietly
When the config module is not present, a spurious "freetype not found"
is output before the pre-existing logic is used. Instead, silence the
module and use FPHSA to report as-if `Freetype` did the search.
See: #25485
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindFreetype.cmake | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake index 583d056..32b2e06 100644 --- a/Modules/FindFreetype.cmake +++ b/Modules/FindFreetype.cmake @@ -66,10 +66,6 @@ directory of a Freetype installation. # everything still works. set(_Freetype_args) -if (Freetype_FIND_QUIETLY) - list(APPEND _Freetype_args - QUIET) -endif () if (Freetype_FIND_VERSION) list(APPEND _Freetype_args "${Freetype_FIND_VERSION}") @@ -100,7 +96,8 @@ if (_Freetype_component_opt) OPTIONAL_COMPONENTS "${_Freetype_component_opt}") endif () unset(_Freetype_component_opt) -find_package(freetype CONFIG ${_Freetype_args}) +# Always find with QUIET to avoid noise when it is not found. +find_package(freetype CONFIG QUIET ${_Freetype_args}) unset(_Freetype_args) if (freetype_FOUND) if (NOT TARGET Freetype::Freetype) @@ -150,6 +147,14 @@ if (freetype_FOUND) set(Freetype_${_Freetype_component}_FOUND "${freetype_${_Freetype_component}_FOUND}") endforeach () unset(_Freetype_component) + + include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) + find_package_handle_standard_args( + Freetype + VERSION_VAR + FREETYPE_VERSION_STRING + ) + return () endif () |