2 # Find the native PNG includes and library
6 # PNG_INCLUDE_DIR, where to find png.h, etc.
7 # PNG_LIBRARIES, the libraries to link against to use PNG.
8 # PNG_DEFINITIONS - You should ADD_DEFINITONS(${PNG_DEFINITIONS}) before compiling code that includes png library files.
9 # PNG_FOUND, If false, do not try to use PNG.
11 # also defined, but not for general use are
12 # PNG_LIBRARY, where to find the PNG library.
14 # None of the above will be defined unles zlib can be found.
20 FIND_PATH(PNG_PNG_INCLUDE_DIR png.h
25 FIND_LIBRARY(PNG_LIBRARY png
31 IF (PNG_PNG_INCLUDE_DIR)
32 # png.h includes zlib.h. Sigh.
33 SET(PNG_INCLUDE_DIR ${PNG_PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
34 SET(PNG_LIBRARIES ${PNG_LIBRARY} ${ZLIB_LIBRARY})
39 # No need to define PNG_USE_DLL here, because it's default for Cygwin.
40 ELSE(BUILD_SHARED_LIBS)
41 SET (PNG_DEFINITIONS -DPNG_STATIC)
42 ENDIF(BUILD_SHARED_LIBS)
45 ENDIF (PNG_PNG_INCLUDE_DIR)