From cc6a7d008b402e5e019237e2576e3d98e815bf91 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Mon, 4 Apr 2022 21:10:25 +0200 Subject: Remove obsolete config variable 'HAVE_LIBPNG_PNG_H' This variable has never been used in the code. Configure and CMake look for a *working* libpng (HAVE_PNG) and set variable HAVE_PNG_H if the header can be included. The alternative to include is always used in the #else clause and doesn't need its own config variable. Configure and CMake log what they find, hence this extra variable is not necessary. --- CMake/options.cmake | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'CMake') diff --git a/CMake/options.cmake b/CMake/options.cmake index ac6f313b5..1d7c08dd3 100644 --- a/CMake/options.cmake +++ b/CMake/options.cmake @@ -444,19 +444,16 @@ if (OPTION_USE_SYSTEM_LIBPNG AND PNG_FOUND) set (_INCLUDE_SAVED ${CMAKE_REQUIRED_INCLUDES}) list (APPEND CMAKE_REQUIRED_INCLUDES ${PNG_INCLUDE_DIRS}) - # FIXME - Force search! Maybe use cache to check for option changes? + # Note: we do not check for explicitly. + # This is assumed to exist if we have PNG_FOUND and don't find - unset (HAVE_PNG_H CACHE) - unset (HAVE_LIBPNG_PNG_H CACHE) + # FIXME - Force search by unsetting the chache variable. Maybe use + # FIXME - another cache variable to check for option changes? - check_include_files (png.h HAVE_PNG_H) + unset (HAVE_PNG_H CACHE) # force search + check_include_file (png.h HAVE_PNG_H) mark_as_advanced (HAVE_PNG_H) - if (NOT HAVE_PNG_H) - check_include_files (libpng/png.h HAVE_LIBPNG_PNG_H) - mark_as_advanced (HAVE_LIBPNG_PNG_H) -endif () - set (CMAKE_REQUIRED_INCLUDES ${_INCLUDE_SAVED}) unset (_INCLUDE_SAVED) @@ -472,7 +469,6 @@ else () set (HAVE_PNG_H 1) set (HAVE_PNG_GET_VALID 1) set (HAVE_PNG_SET_TRNS_TO_ALPHA 1) - set (HAVE_LIBPNG_PNG_H 0) include_directories (${CMAKE_CURRENT_SOURCE_DIR}/png) endif () -- cgit v1.2.3