From 07558db6a23ef711e58678f53ff95b42f879bc44 Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Wed, 30 Aug 2006 13:47:54 -0400 Subject: [PATCH] ENH: also look in /usr/local/include/libpng (OpenBSD) ENH: error out with FATAL_ERROR if REQUIRED was given but png hasn't been found Alex --- Modules/FindPNG.cmake | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake index f07824234..797dd0254 100644 --- a/Modules/FindPNG.cmake +++ b/Modules/FindPNG.cmake @@ -12,10 +12,13 @@ # PNG depends on Zlib INCLUDE(FindZLIB) +SET(PNG_FOUND "NO") + IF(ZLIB_FOUND) FIND_PATH(PNG_PNG_INCLUDE_DIR png.h /usr/local/include /usr/include + /usr/local/include/libpng # OpenBSD ) SET(PNG_NAMES ${PNG_NAMES} png libpng) @@ -42,4 +45,14 @@ IF(ZLIB_FOUND) ENDIF(ZLIB_FOUND) +IF (PNG_FOUND) + IF (NOT PNG_FIND_QUIETLY) + MESSAGE(STATUS "Found PNG: ${PNG_LIBRARY}") + ENDIF (NOT PNG_FIND_QUIETLY) +ELSE (PNG_FOUND) + IF (PNG_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find PNG library") + ENDIF (PNG_FIND_REQUIRED) +ENDIF (PNG_FOUND) + MARK_AS_ADVANCED(PNG_PNG_INCLUDE_DIR PNG_LIBRARY )