FindLibXml2: support version selection

This commit is contained in:
Rolf Eike Beer 2012-01-23 19:26:16 +01:00
parent 86c9604f98
commit a5fd3915c9
1 changed files with 8 additions and 2 deletions

View File

@ -6,6 +6,7 @@
# 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)
#=============================================================================
# Copyright 2006-2009 Kitware, Inc.
@ -47,7 +48,12 @@ SET(XMLLINT_EXECUTABLE "${LIBXML2_XMLLINT_EXECUTABLE}")
# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2
REQUIRED_VARS LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR
VERSION_VAR PC_LIBXML_VERSION)
IF(LIBXML2_FOUND)
SET(LIBXML2_VERSION_STRING ${PC_LIBXML_VERSION})
ENDIF()
MARK_AS_ADVANCED(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES LIBXML2_XMLLINT_EXECUTABLE)