FindPNGΒΆ

Find the native PNG includes and library

This module searches libpng, the library for working with PNG images.

It defines the following variables

PNG_INCLUDE_DIRS, where to find png.h, etc.
PNG_LIBRARIES, the libraries to link against to use PNG.
PNG_DEFINITIONS - You should add_definitons(${PNG_DEFINITIONS}) before compiling code that includes png library files.
PNG_FOUND, If false, do not try to use PNG.
PNG_VERSION_STRING - the version of the PNG library found (since CMake 2.8.8)

Also defined, but not for general use are

PNG_LIBRARY, where to find the PNG library.

For backward compatiblity the variable PNG_INCLUDE_DIR is also set. It has the same value as PNG_INCLUDE_DIRS.

Since PNG depends on the ZLib compression library, none of the above will be defined unless ZLib can be found.