aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Montel <montel@kde.org>2006-02-01 16:47:58 +0000
committerLaurent Montel <montel@kde.org>2006-02-01 16:47:58 +0000
commitc3f3de43934521c05c9744c67743ac2a87d31996 (patch)
treea158b0408ce9458d6d06f93fca13001f2aadc62b
parentbbbe989cbf38611650e71513f1865b8c8c5597f0 (diff)
downloadextra-cmake-modules-c3f3de43934521c05c9744c67743ac2a87d31996.tar.gz
extra-cmake-modules-c3f3de43934521c05c9744c67743ac2a87d31996.tar.bz2
Add module to find png lib
svn path=/trunk/KDE/kdelibs/; revision=504646
-rw-r--r--modules/FindPNG.cmake35
1 files changed, 35 insertions, 0 deletions
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)
+