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
This commit is contained in:
Alexander Neundorf 2006-08-30 13:47:54 -04:00
parent 416738b721
commit 07558db6a2
1 changed files with 13 additions and 0 deletions

View File

@ -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 )