summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorJulien Isorce <julien.isorce@gmail.com>2009-02-07 21:19:24 +0100
committerDavid Schleef <ds@schleef.org>2009-02-10 22:07:15 -0800
commit887bca76ce29fd1a3371ac1402daebf87021b814 (patch)
tree7096acedca6778180f72381582449b913a442fdb /cmake
parent341affa93db9f055c0b235ee93c896e71d5cd48f (diff)
CMake build now checks for libpng
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/FindLibpng.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/cmake/modules/FindLibpng.cmake b/cmake/modules/FindLibpng.cmake
new file mode 100644
index 0000000..c522079
--- /dev/null
+++ b/cmake/modules/FindLibpng.cmake
@@ -0,0 +1,17 @@
+FILE(TO_CMAKE_PATH "$ENV{PNG_DIR}" TRY1_DIR)
+FILE(TO_CMAKE_PATH "${PNG_DIR}" TRY2_DIR)
+FILE(GLOB PNG_DIR ${TRY1_DIR} ${TRY2_DIR})
+
+FIND_PATH(PNG_INCLUDE_DIR png.h
+ PATHS ${PNG_DIR}/include /usr/local/include /usr/include
+ ENV INCLUDE DOC "Directory containing png.h include file")
+
+FIND_LIBRARY(PNG_LIBRARY NAMES png12
+ PATHS ${PNG_DIR}/bin ${PNG_DIR}/win32/bin ${PNG_DIR}/lib ${GLEW_DIR}/win32/lib /usr/local/lib /usr/lib
+ ENV LIB
+ DOC "png library to link with"
+ NO_SYSTEM_ENVIRONMENT_PATH)
+
+IF (PNG_INCLUDE_DIR AND PNG_LIBRARY)
+ SET(PNG_FOUND TRUE)
+ENDIF (PNG_INCLUDE_DIR AND PNG_LIBRARY)