mirror of
https://github.com/reactos/CMake.git
synced 2025-01-31 08:52:21 +00:00
FindLibXml2: provide imported target LibXml2::xmllint
This commit is contained in:
parent
a07134e339
commit
a179cbf205
4
Help/release/dev/xmllint-target.rst
Normal file
4
Help/release/dev/xmllint-target.rst
Normal file
@ -0,0 +1,4 @@
|
||||
xmllint-target
|
||||
--------------
|
||||
|
||||
* The :module:`FindLibXml2` module now provides an imported target for the xmllint executable
|
@ -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()
|
||||
|
@ -14,3 +14,7 @@ add_executable(test_var main.c)
|
||||
target_include_directories(test_var PRIVATE ${LIBXML2_INCLUDE_DIRS})
|
||||
target_link_libraries(test_var PRIVATE ${LIBXML2_LIBRARIES})
|
||||
add_test(NAME test_var COMMAND test_var)
|
||||
|
||||
add_test(NAME xmllint_tgt COMMAND LibXml2::xmllint --version)
|
||||
|
||||
add_test(NAME xmllint_var COMMAND ${LIBXML2_XMLLINT_EXECUTABLE} --version)
|
||||
|
Loading…
x
Reference in New Issue
Block a user