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 )