summaryrefslogtreecommitdiffstats
path: root/Modules/FindEXPAT.cmake
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-07-19 13:00:51 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-07-19 13:00:51 (GMT)
commitc7770b8edbff442267563bd3036cef8fdb0cc4a9 (patch)
tree1c73f377e04981e72043a9ac5fff8fef0eca343b /Modules/FindEXPAT.cmake
parentb6b1ebe2950e2437fffd4eecbe3f1992fc63e812 (diff)
downloadCMake-c7770b8edbff442267563bd3036cef8fdb0cc4a9.zip
CMake-c7770b8edbff442267563bd3036cef8fdb0cc4a9.tar.gz
CMake-c7770b8edbff442267563bd3036cef8fdb0cc4a9.tar.bz2
ENH: use the new FIND_PACKAGE_HANDLE_STANDARD_ARGS() macro in most of the
not-too-complicated modules -remove unnecessary default search paths used in the FIND_XXX() calls Alex
Diffstat (limited to 'Modules/FindEXPAT.cmake')
-rw-r--r--Modules/FindEXPAT.cmake28
1 files changed, 9 insertions, 19 deletions
diff --git a/Modules/FindEXPAT.cmake b/Modules/FindEXPAT.cmake
index d48eef3..d087966 100644
--- a/Modules/FindEXPAT.cmake
+++ b/Modules/FindEXPAT.cmake
@@ -7,32 +7,22 @@
# 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)
+
+# handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(EXPAT EXPAT_LIBRARY EXPAT_INCLUDE_PATH)
# Copy the results to the output variables.
-IF(EXPAT_INCLUDE_DIR AND EXPAT_LIBRARY)
- SET(EXPAT_FOUND 1)
+IF(EXPAT_FOUND)
SET(EXPAT_LIBRARIES ${EXPAT_LIBRARY})
SET(EXPAT_INCLUDE_DIRS ${EXPAT_INCLUDE_DIR})
-ELSE(EXPAT_INCLUDE_DIR AND EXPAT_LIBRARY)
- SET(EXPAT_FOUND 0)
+ELSE(EXPAT_FOUND)
SET(EXPAT_LIBRARIES)
SET(EXPAT_INCLUDE_DIRS)
-ENDIF(EXPAT_INCLUDE_DIR AND EXPAT_LIBRARY)
+ENDIF(EXPAT_FOUND)
-# 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)
+MARK_AS_ADVANCED(EXPAT_INCLUDE_DIR EXPAT_LIBRARY)