summaryrefslogtreecommitdiff
path: root/Modules/FindLibXml2.cmake
diff options
context:
space:
mode:
authorSylvain Joubert <joubert.sy@gmail.com>2019-12-24 16:42:32 +0100
committerSylvain Joubert <joubert.sy@gmail.com>2019-12-31 12:45:26 +0100
commita179cbf205501b6470d2f8e892876cc8672e7096 (patch)
treefe85ec5e17f16ba376fb31eb3fa0b160cb9b59c9 /Modules/FindLibXml2.cmake
parenta07134e33934bdd4b50d2a4d3293fcd3f495a3d6 (diff)
downloadcmake-a179cbf205501b6470d2f8e892876cc8672e7096.tar.gz
FindLibXml2: provide imported target LibXml2::xmllint
Diffstat (limited to 'Modules/FindLibXml2.cmake')
-rw-r--r--Modules/FindLibXml2.cmake13
1 files changed, 11 insertions, 2 deletions
diff --git a/Modules/FindLibXml2.cmake b/Modules/FindLibXml2.cmake
index da8bfe0d4a..9480ceaf91 100644
--- a/Modules/FindLibXml2.cmake
+++ b/Modules/FindLibXml2.cmake
@@ -10,8 +10,12 @@ Find the XML processing library (libxml2).
IMPORTED Targets
^^^^^^^^^^^^^^^^
-This module defines :prop_tgt:`IMPORTED` target ``LibXml2::LibXml2``, if
-libxml2 has been found.
+The following :prop_tgt:`IMPORTED` targets may be defined:
+
+``LibXml2::LibXml2``
+ If the libxml2 library has been found
+``LibXml2::xmllint``
+ If the xmllint command-line executable has been found
Result variables
^^^^^^^^^^^^^^^^
@@ -100,3 +104,8 @@ if(LibXml2_FOUND AND NOT TARGET LibXml2::LibXml2)
set_target_properties(LibXml2::LibXml2 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBXML2_INCLUDE_DIRS}")
set_property(TARGET LibXml2::LibXml2 APPEND PROPERTY IMPORTED_LOCATION "${LIBXML2_LIBRARY}")
endif()
+
+if(LIBXML2_XMLLINT_EXECUTABLE AND NOT TARGET LibXml2::xmllint)
+ add_executable(LibXml2::xmllint IMPORTED)
+ set_target_properties(LibXml2::xmllint PROPERTIES IMPORTED_LOCATION "${LIBXML2_XMLLINT_EXECUTABLE}")
+endif()