summaryrefslogtreecommitdiffstats
path: root/Modules/FindLibXml2.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/FindLibXml2.cmake')
-rw-r--r--Modules/FindLibXml2.cmake18
1 files changed, 4 insertions, 14 deletions
diff --git a/Modules/FindLibXml2.cmake b/Modules/FindLibXml2.cmake
index 47136df..93507e6 100644
--- a/Modules/FindLibXml2.cmake
+++ b/Modules/FindLibXml2.cmake
@@ -36,21 +36,11 @@ FIND_LIBRARY(LIBXML2_LIBRARIES NAMES xml2 libxml2
${_LibXml2LinkDir}
)
-IF (LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES)
- SET(LIBXML2_FOUND TRUE)
-ELSE (LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES)
- SET(LIBXML2_FOUND FALSE)
-ENDIF (LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES)
+INCLUDE(FindPackageHandleStandardArgs)
-IF (LIBXML2_FOUND)
- IF (NOT LibXml2_FIND_QUIETLY)
- MESSAGE(STATUS "Found LibXml2: ${LIBXML2_LIBRARIES}")
- ENDIF (NOT LibXml2_FIND_QUIETLY)
-ELSE (LIBXML2_FOUND)
- IF (LibXml2_FIND_REQUIRED)
- MESSAGE(SEND_ERROR "Could NOT find LibXml2")
- ENDIF (LibXml2_FIND_REQUIRED)
-ENDIF (LIBXML2_FOUND)
+# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if
+# all listed variables are TRUE
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
MARK_AS_ADVANCED(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES)