mirror of
https://gitlab.gnome.org/GNOME/libxml2
synced 2025-03-28 21:33:13 +00:00
Check if variables exist when defining targets
This commit is contained in:
parent
c26e45259c
commit
95519737af
@ -90,7 +90,7 @@ set(LIBXML2_MODULES @WITH_MODULES@)
|
|||||||
|
|
||||||
mark_as_advanced(LIBXML2_LIBRARY LIBXML2_XMLCATALOG_EXECUTABLE LIBXML2_XMLLINT_EXECUTABLE)
|
mark_as_advanced(LIBXML2_LIBRARY LIBXML2_XMLCATALOG_EXECUTABLE LIBXML2_XMLLINT_EXECUTABLE)
|
||||||
|
|
||||||
if(NOT TARGET LibXml2::LibXml2)
|
if(NOT TARGET LibXml2::LibXml2 AND DEFINED LIBXML2_LIBRARY AND DEFINED LIBXML2_INCLUDE_DIRS)
|
||||||
add_library(LibXml2::LibXml2 UNKNOWN IMPORTED)
|
add_library(LibXml2::LibXml2 UNKNOWN IMPORTED)
|
||||||
set_target_properties(LibXml2::LibXml2 PROPERTIES IMPORTED_LOCATION "${LIBXML2_LIBRARY}")
|
set_target_properties(LibXml2::LibXml2 PROPERTIES IMPORTED_LOCATION "${LIBXML2_LIBRARY}")
|
||||||
set_target_properties(LibXml2::LibXml2 PROPERTIES INTERFACE_COMPILE_OPTIONS "${LIBXML2_DEFINITIONS}")
|
set_target_properties(LibXml2::LibXml2 PROPERTIES INTERFACE_COMPILE_OPTIONS "${LIBXML2_DEFINITIONS}")
|
||||||
@ -98,12 +98,12 @@ if(NOT TARGET LibXml2::LibXml2)
|
|||||||
set_target_properties(LibXml2::LibXml2 PROPERTIES INTERFACE_LINK_LIBRARIES "${LIBXML2_INTERFACE_LINK_LIBRARIES}")
|
set_target_properties(LibXml2::LibXml2 PROPERTIES INTERFACE_LINK_LIBRARIES "${LIBXML2_INTERFACE_LINK_LIBRARIES}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT TARGET LibXml2::xmlcatalog)
|
if(NOT TARGET LibXml2::xmlcatalog AND DEFINED LIBXML2_XMLCATALOG_EXECUTABLE)
|
||||||
add_executable(LibXml2::xmlcatalog IMPORTED)
|
add_executable(LibXml2::xmlcatalog IMPORTED)
|
||||||
set_target_properties(LibXml2::xmlcatalog PROPERTIES IMPORTED_LOCATION "${LIBXML2_XMLCATALOG_EXECUTABLE}")
|
set_target_properties(LibXml2::xmlcatalog PROPERTIES IMPORTED_LOCATION "${LIBXML2_XMLCATALOG_EXECUTABLE}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT TARGET LibXml2::xmllint)
|
if(NOT TARGET LibXml2::xmllint AND DEFINED LIBXML2_XMLLINT_EXECUTABLE)
|
||||||
add_executable(LibXml2::xmllint IMPORTED)
|
add_executable(LibXml2::xmllint IMPORTED)
|
||||||
set_target_properties(LibXml2::xmllint PROPERTIES IMPORTED_LOCATION "${LIBXML2_XMLLINT_EXECUTABLE}")
|
set_target_properties(LibXml2::xmllint PROPERTIES IMPORTED_LOCATION "${LIBXML2_XMLLINT_EXECUTABLE}")
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user