summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-03-09 12:44:18 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-03-09 12:44:30 (GMT)
commit6e56f288083e7cd21d67756b1034604d9184b9b4 (patch)
tree1efe03c8ad5ea6743427769d205224fed7264269 /Modules
parente11410bb0c66152c6fafb56d40c9328abaa7a1ab (diff)
parent9ef3abd3f39542ecbdfda0014a7f1b4c3bea50a9 (diff)
downloadCMake-6e56f288083e7cd21d67756b1034604d9184b9b4.zip
CMake-6e56f288083e7cd21d67756b1034604d9184b9b4.tar.gz
CMake-6e56f288083e7cd21d67756b1034604d9184b9b4.tar.bz2
Merge topic 'libxml2-target'
9ef3abd3f3 FindLibXml2: provide imported target LibXml2::LibXml2 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1823
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindLibXml2.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/Modules/FindLibXml2.cmake b/Modules/FindLibXml2.cmake
index 8ac2980..615de49 100644
--- a/Modules/FindLibXml2.cmake
+++ b/Modules/FindLibXml2.cmake
@@ -7,6 +7,12 @@
#
# Find the XML processing library (libxml2).
#
+# IMPORTED Targets
+# ^^^^^^^^^^^^^^^^
+#
+# This module defines :prop_tgt:`IMPORTED` target ``LibXml2::LibXml2``, if
+# libxml2 has been found.
+#
# Result variables
# ^^^^^^^^^^^^^^^^
#
@@ -87,3 +93,9 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2
VERSION_VAR LIBXML2_VERSION_STRING)
mark_as_advanced(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARY LIBXML2_XMLLINT_EXECUTABLE)
+
+if(LibXml2_FOUND AND NOT TARGET LibXml2::LibXml2)
+ add_library(LibXml2::LibXml2 UNKNOWN IMPORTED)
+ set_target_properties(LibXml2::LibXml2 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBXML2_INCLUDE_DIRS}")
+ set_property(TARGET LibXml2::LibXml2 APPEND PROPERTY IMPORTED_LOCATION "${LIBXML2_LIBRARY}")
+endif()