summaryrefslogtreecommitdiffstats
path: root/Modules/FindEXPAT.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-10-19 16:57:28 (GMT)
committerBrad King <brad.king@kitware.com>2006-10-19 16:57:28 (GMT)
commitd913a7b1e758d789fd8354edcb7b80165b5169cf (patch)
tree6499e0f12e1dd64f8d8b8ef159cf4053adb8e1c2 /Modules/FindEXPAT.cmake
parentd25595a83cf524765965061c03c724c780abc5bb (diff)
downloadCMake-d913a7b1e758d789fd8354edcb7b80165b5169cf.zip
CMake-d913a7b1e758d789fd8354edcb7b80165b5169cf.tar.gz
CMake-d913a7b1e758d789fd8354edcb7b80165b5169cf.tar.bz2
ENH: Find module for EXPAT library.
Diffstat (limited to 'Modules/FindEXPAT.cmake')
-rw-r--r--Modules/FindEXPAT.cmake38
1 files changed, 38 insertions, 0 deletions
diff --git a/Modules/FindEXPAT.cmake b/Modules/FindEXPAT.cmake
new file mode 100644
index 0000000..d48eef3
--- /dev/null
+++ b/Modules/FindEXPAT.cmake
@@ -0,0 +1,38 @@
+# - Find expat
+# Find the native EXPAT headers and libraries.
+#
+# EXPAT_INCLUDE_DIRS - where to find expat.h, etc.
+# EXPAT_LIBRARIES - List of libraries when using expat.
+# EXPAT_FOUND - True if expat found.
+
+# Look for the header file.
+FIND_PATH(EXPAT_INCLUDE_DIR NAMES expat.h)
+MARK_AS_ADVANCED(EXPAT_INCLUDE_DIR)
+
+# Look for the library.
+FIND_LIBRARY(EXPAT_LIBRARY NAMES expat)
+MARK_AS_ADVANCED(EXPAT_LIBRARY)
+
+# Copy the results to the output variables.
+IF(EXPAT_INCLUDE_DIR AND EXPAT_LIBRARY)
+ SET(EXPAT_FOUND 1)
+ SET(EXPAT_LIBRARIES ${EXPAT_LIBRARY})
+ SET(EXPAT_INCLUDE_DIRS ${EXPAT_INCLUDE_DIR})
+ELSE(EXPAT_INCLUDE_DIR AND EXPAT_LIBRARY)
+ SET(EXPAT_FOUND 0)
+ SET(EXPAT_LIBRARIES)
+ SET(EXPAT_INCLUDE_DIRS)
+ENDIF(EXPAT_INCLUDE_DIR AND EXPAT_LIBRARY)
+
+# Report the results.
+IF(NOT EXPAT_FOUND)
+ SET(EXPAT_DIR_MESSAGE
+ "EXPAT was not found. Make sure EXPAT_LIBRARY and EXPAT_INCLUDE_DIR are set.")
+ IF(NOT EXPAT_FIND_QUIETLY)
+ MESSAGE(STATUS "${EXPAT_DIR_MESSAGE}")
+ ELSE(NOT EXPAT_FIND_QUIETLY)
+ IF(EXPAT_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "${EXPAT_DIR_MESSAGE}")
+ ENDIF(EXPAT_FIND_REQUIRED)
+ ENDIF(NOT EXPAT_FIND_QUIETLY)
+ENDIF(NOT EXPAT_FOUND)