summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorIan Scott <ian.m.scott@stud.man.ac.uk>2002-09-02 19:46:04 (GMT)
committerIan Scott <ian.m.scott@stud.man.ac.uk>2002-09-02 19:46:04 (GMT)
commitc82608591728c8c88d0ef596655808eda93664a2 (patch)
treecc04202251556d479088130de8b623a49d0e47e2 /Modules
parent8600beb1ed81dccbe427c78d501c81a6c46eee69 (diff)
downloadCMake-c82608591728c8c88d0ef596655808eda93664a2.zip
CMake-c82608591728c8c88d0ef596655808eda93664a2.tar.gz
CMake-c82608591728c8c88d0ef596655808eda93664a2.tar.bz2
Copied the X11 PNG and ZLIB functoinality from VXL
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindPNG.cmake1
-rw-r--r--Modules/FindX11.cmake69
-rw-r--r--Modules/FindZLib.cmake23
3 files changed, 45 insertions, 48 deletions
diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake
index 528a17f..897f2ee 100644
--- a/Modules/FindPNG.cmake
+++ b/Modules/FindPNG.cmake
@@ -6,6 +6,7 @@
# PNG_INCLUDE_DIR, where to find png.h, etc.
# PNG_LIBRARIES, the libraries to link against to use PNG.
# PNG_FOUND, If false, do try to use PNG.
+# PNG_DEFINITIONS - You should ADD_DEFINITONS(${PNG_DEFINITIONS}) before compiling code that includes png library files.
# also defined, but not for general use are
# PNG_LIBRARY, where to find the PNG library.
diff --git a/Modules/FindX11.cmake b/Modules/FindX11.cmake
index 6043a35..7d203cc 100644
--- a/Modules/FindX11.cmake
+++ b/Modules/FindX11.cmake
@@ -1,33 +1,52 @@
#
-# try to find X11 libraries on UNIX systems once done this will define
+# try to find X11 on UNIX systems.
#
-# X11_INCLUDE_PATH = where the X11 include directory can be found
-# X11_LIBRARY = the name of the X11 library to link with
-#
-
-IF (WIN32)
- SET (X11_LIBRARY x11 CACHE STRING "X11 library")
-ELSE (WIN32)
- FIND_PATH(X11_INCLUDE_PATH X11.h
- /usr/include
- /usr/local/include
- /usr/openwin/share/include
- /opt/graphics/OpenGL/include
- /usr/X11R6/include
+# The following values are defined
+# X11_INCLUDE_DIR - where to find X11.h
+# X11_LIBRARIES - link against these to use X11
+# X11_FOUND - True if X11 is available
+# X11_Xext_FOUND - True if the X11 extensions are available.
+IF (UNIX)
+
+ FIND_PATH(X11_INCLUDE_DIR X11/X.h
+ /usr/include
+ /usr/local/include
+ /usr/openwin/include
+ /usr/openwin/share/include
+ /usr/X11R6/include
+ /usr/include/X11
+ /opt/graphics/OpenGL/include
)
- MARK_AS_ADVANCED(
- X11_INCLUDE_PATH
+
+
+ FIND_LIBRARY(X11_X11_LIBRARY X11
+ /usr/lib
+ /usr/local/lib
+ /usr/openwin/lib
+ /usr/X11R6/lib
)
- FIND_LIBRARY(X11_LIBRARY libX11.so
- /usr/lib
- /usr/local/lib
- /usr/X11R6/lib
- /usr/openwin/lib
+ FIND_LIBRARY(X11_Xext_LIBRARY Xext
+ /usr/lib
+ /usr/local/lib
+ /usr/openwin/lib
+ /usr/X11R6/lib
)
-ENDIF (WIN32)
+ IF(X11_INCLUDE_DIR)
+
+ IF(X11_X11_LIBRARY)
+ SET( X11_FOUND "YES" )
+ SET( X11_LIBRARIES ${X11_X11_LIBRARY} )
+ ENDIF(X11_X11_LIBRARY)
+
+ IF(X11_Xext_LIBRARY)
+ SET( X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xext_LIBRARY} )
+ SET( X11_Xext_FOUND "YES")
+ ENDIF(X11_Xext_LIBRARY)
+
+ ENDIF(X11_INCLUDE_PATH)
-MARK_AS_ADVANCED(
- X11_LIBRARY
-)
+ # Deprecated variable fro backwards compatibility with CMake 1.4
+ SET (X11_LIBRARY ${X11_X11_LIBRARY})
+ENDIF (UNIX)
diff --git a/Modules/FindZLib.cmake b/Modules/FindZLib.cmake
index cb23b6d..e69de29 100644
--- a/Modules/FindZLib.cmake
+++ b/Modules/FindZLib.cmake
@@ -1,23 +0,0 @@
-#
-# Find the native ZLIB includes and library
-#
-# ZLIB_INCLUDE_DIR - where to find zlib.h, etc.
-# ZLIB_LIBRARIES - List of fully qualified libraries to link against when using zlib.
-# ZLIB_FOUND - Do not attempt to use zlib if "no" or undefined.
-
-FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
- /usr/local/include
- /usr/include
-)
-
-FIND_LIBRARY(ZLIB_LIBRARY z
- /usr/lib
- /usr/local/lib
-)
-
-IF(ZLIB_INCLUDE_DIR)
- IF(ZLIB_LIBRARY)
- SET( ZLIB_LIBRARIES ${ZLIB_LIBRARY} )
- SET( ZLIB_FOUND "YES" )
- ENDIF(ZLIB_LIBRARY)
-ENDIF(ZLIB_INCLUDE_DIR)