From c3f3de43934521c05c9744c67743ac2a87d31996 Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Wed, 1 Feb 2006 16:47:58 +0000 Subject: Add module to find png lib svn path=/trunk/KDE/kdelibs/; revision=504646 --- modules/FindPNG.cmake | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 modules/FindPNG.cmake diff --git a/modules/FindPNG.cmake b/modules/FindPNG.cmake new file mode 100644 index 00000000..1442bbcf --- /dev/null +++ b/modules/FindPNG.cmake @@ -0,0 +1,35 @@ +# - Try to find PNG +# Once done this will define +# +# PNG_FOUND - system has PNG +# PNG_INCLUDE_DIR - the PNG include directory +# PNG_LIBRARY - Link these to use OpenGL and GLU +# PNG_DEFINITIONS - Compiler switches required for using PNG +# + + +FIND_PATH(PNG_INCLUDE_DIR png.h + /usr/include + /usr/local/include +) + +FIND_LIBRARY(PNG_LIBRARY NAMES png + PATHS + /usr/lib + /usr/local/lib +) + +IF(PNG_INCLUDE_DIR AND PNG_LIBRARY) + SET(PNg_FOUND TRUE) +ENDIF(PNG_INCLUDE_DIR AND PNG_LIBRARY) + +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") + ENDIF(PNG_FIND_REQUIRED) +ENDIF(PNG_FOUND) + -- cgit v1.2.1