summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMake/options.cmake16
-rw-r--r--configh.cmake.in4
-rw-r--r--configh.in4
-rw-r--r--configure.ac2
4 files changed, 12 insertions, 14 deletions
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 <libpng/png.h> explicitly.
+ # This is assumed to exist if we have PNG_FOUND and don't find <png.h>
- 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 ()
diff --git a/configh.cmake.in b/configh.cmake.in
index cf537af82..dde9ee40a 100644
--- a/configh.cmake.in
+++ b/configh.cmake.in
@@ -260,10 +260,12 @@
/*
* Which header file do we include for libpng?
+ * ifdef HAVE_PNG_H : <png.h>
+ * else : <libpng/png.h>
+ * There is no other choice.
*/
#cmakedefine HAVE_PNG_H 1
-#cmakedefine HAVE_LIBPNG_PNG_H 1
/*
* Do we have the png_xyz() functions?
diff --git a/configh.in b/configh.in
index 86e6897c6..e45061b31 100644
--- a/configh.in
+++ b/configh.in
@@ -259,10 +259,12 @@
/*
* Which header file do we include for libpng?
+ * ifdef HAVE_PNG_H : <png.h>
+ * else : <libpng/png.h>
+ * There is no other choice.
*/
#undef HAVE_PNG_H
-#undef HAVE_LIBPNG_PNG_H
/*
* Do we have the png_xyz() functions?
diff --git a/configure.ac b/configure.ac
index 2f9d83126..ca2a7bcc2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -738,7 +738,6 @@ AS_IF([test x$enable_localpng != xyes], [
syspnginc_ok=yes
])
AC_CHECK_HEADER([libpng/png.h], [
- AC_DEFINE([HAVE_LIBPNG_PNG_H])
syspnginc_ok=yes
])
AS_IF([test x$syspnginc_ok = xyes], [
@@ -815,7 +814,6 @@ AC_SUBST([JPEGINC])
AC_SUBST([PNG])
AC_SUBST([PNGINC])
AC_SUBST([HAVE_PNG_H])
-AC_SUBST([HAVE_LIBPNG_H])
AC_SUBST([ZLIB])
AC_SUBST([ZLIBINC])