Commit 96041907 authored by Brad King's avatar Brad King Committed by Kitware Robot

Merge topic 'FindLibXml2-standard-vars'

a1b38865 FindLibXml2: Switch to standard module variable names
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !1043
parents 2d5e4946 a1b38865
Pipeline #64970 failed with stage
in 0 seconds
......@@ -5,18 +5,37 @@
# FindLibXml2
# -----------
#
# Try to find the LibXml2 xml processing library
# Find the XML processing library (libxml2).
#
# Once done this will define
# Result variables
# ^^^^^^^^^^^^^^^^
#
# ::
# This module will set the following variables in your project:
#
# LIBXML2_FOUND - System has LibXml2
# LIBXML2_INCLUDE_DIR - The LibXml2 include directory
# LIBXML2_LIBRARIES - The libraries needed to use LibXml2
# LIBXML2_DEFINITIONS - Compiler switches required for using LibXml2
# LIBXML2_XMLLINT_EXECUTABLE - The XML checking tool xmllint coming with LibXml2
# LIBXML2_VERSION_STRING - the version of LibXml2 found (since CMake 2.8.8)
# ``LIBXML2_FOUND``
# true if libxml2 headers and libraries were found
# ``LIBXML2_INCLUDE_DIR``
# the directory containing LibXml2 headers
# ``LIBXML2_INCLUDE_DIRS``
# list of the include directories needed to use LibXml2
# ``LIBXML2_LIBRARIES``
# LibXml2 libraries to be linked
# ``LIBXML2_DEFINITIONS``
# the compiler switches required for using LibXml2
# ``LIBXML2_XMLLINT_EXECUTABLE``
# path to the XML checking tool xmllint coming with LibXml2
# ``LIBXML2_VERSION_STRING``
# the version of LibXml2 found (since CMake 2.8.8)
#
# Cache variables
# ^^^^^^^^^^^^^^^
#
# The following cache variables may also be set:
#
# ``LIBXML2_INCLUDE_DIR``
# the directory containing LibXml2 headers
# ``LIBXML2_LIBRARY``
# path to the LibXml2 library
# use pkg-config to get the directories and then use these values
# in the find_path() and find_library() calls
......@@ -31,7 +50,7 @@ find_path(LIBXML2_INCLUDE_DIR NAMES libxml/xpath.h
PATH_SUFFIXES libxml2
)
find_library(LIBXML2_LIBRARIES NAMES xml2 libxml2
find_library(LIBXML2_LIBRARY NAMES xml2 libxml2
HINTS
${PC_LIBXML_LIBDIR}
${PC_LIBXML_LIBRARY_DIRS}
......@@ -52,9 +71,12 @@ elseif(LIBXML2_INCLUDE_DIR AND EXISTS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.
unset(libxml2_version_str)
endif()
set(LIBXML2_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR} ${PC_LIBXML_INCLUDE_DIRS})
set(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY})
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2
REQUIRED_VARS LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR
REQUIRED_VARS LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR
VERSION_VAR LIBXML2_VERSION_STRING)
mark_as_advanced(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES LIBXML2_XMLLINT_EXECUTABLE)
mark_as_advanced(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARY LIBXML2_XMLLINT_EXECUTABLE)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment