summaryrefslogtreecommitdiffstats
path: root/Modules/FindTIFF.cmake
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2023-12-13 16:28:18 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2023-12-13 18:12:45 (GMT)
commite8e7d9f775c3811ae58de75056c68f300868081e (patch)
tree69c9c5eecd6cec1010f81c4270c23f063c49d5aa /Modules/FindTIFF.cmake
parenta575bebf0d28cb00481da66f0aad306262b69d13 (diff)
downloadCMake-e8e7d9f775c3811ae58de75056c68f300868081e.zip
CMake-e8e7d9f775c3811ae58de75056c68f300868081e.tar.gz
CMake-e8e7d9f775c3811ae58de75056c68f300868081e.tar.bz2
FindTIFF: always find the config module quietly
When the config module is not present, a spurious "tiff not found" is output before the pre-existing logic is used. Instead, silence the module and use FPHSA to report as-if `TIFF` did the search. Fixes: #25485
Diffstat (limited to 'Modules/FindTIFF.cmake')
-rw-r--r--Modules/FindTIFF.cmake13
1 files changed, 8 insertions, 5 deletions
diff --git a/Modules/FindTIFF.cmake b/Modules/FindTIFF.cmake
index 4a93c04..45b3164 100644
--- a/Modules/FindTIFF.cmake
+++ b/Modules/FindTIFF.cmake
@@ -66,10 +66,6 @@ The following cache variables may also be set:
#]=======================================================================]
set(_TIFF_args)
-if (TIFF_FIND_QUIETLY)
- list(APPEND _TIFF_args
- QUIET)
-endif ()
if (TIFF_FIND_VERSION)
list(APPEND _TIFF_args
"${TIFF_FIND_VERSION}")
@@ -100,7 +96,8 @@ if (_TIFF_component_opt)
OPTIONAL_COMPONENTS "${_TIFF_component_opt}")
endif ()
unset(_TIFF_component_opt)
-find_package(tiff CONFIG ${_TIFF_args})
+# Always find with QUIET to avoid noise when it is not found.
+find_package(tiff CONFIG QUIET ${_TIFF_args})
unset(_TIFF_args)
if (tiff_FOUND)
if (NOT TARGET TIFF::TIFF)
@@ -135,6 +132,12 @@ if (tiff_FOUND)
set(TIFF_${_TIFF_component}_FOUND "${tiff_${_TIFF_component}_FOUND}")
endforeach ()
unset(_TIFF_component)
+
+ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+ find_package_handle_standard_args(TIFF
+ HANDLE_COMPONENTS
+ VERSION_VAR TIFF_VERSION_STRING)
+
return ()
endif ()