diff options
author | Rolf Eike Beer <eike@sf-mail.de> | 2018-03-05 22:42:35 (GMT) |
---|---|---|
committer | Rolf Eike Beer <eike@sf-mail.de> | 2018-03-08 17:31:12 (GMT) |
commit | 9ef3abd3f39542ecbdfda0014a7f1b4c3bea50a9 (patch) | |
tree | aff61661ec3b78f7b2ce0017b3e5f36c76636efd /Modules/FindLibXml2.cmake | |
parent | 156a959410cfbd33c648e7b8993d32fd8f9af00a (diff) | |
download | CMake-9ef3abd3f39542ecbdfda0014a7f1b4c3bea50a9.zip CMake-9ef3abd3f39542ecbdfda0014a7f1b4c3bea50a9.tar.gz CMake-9ef3abd3f39542ecbdfda0014a7f1b4c3bea50a9.tar.bz2 |
FindLibXml2: provide imported target LibXml2::LibXml2
Diffstat (limited to 'Modules/FindLibXml2.cmake')
-rw-r--r-- | Modules/FindLibXml2.cmake | 12 |
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() |