0
0
mirror of https://github.com/zeux/pugixml.git synced 2025-01-13 17:37:58 +08:00

Fix compatibility issue with CMake 3.10

target_link_libraries/INTERFACE doesn't seem to work on CMake 3.10, but
directly setting the property does work.

Fixes #390.
This commit is contained in:
Arseny Kapoulkine 2020-12-18 09:07:44 -08:00
parent 907955280f
commit e2bc4f4af2

View File

@ -7,5 +7,6 @@ include("${CMAKE_CURRENT_LIST_DIR}/pugixml-targets.cmake")
# for compatibility. # for compatibility.
if (NOT DEFINED PACKAGE_FIND_VERSION OR PACKAGE_FIND_VERSION VERSION_LESS "1.11") if (NOT DEFINED PACKAGE_FIND_VERSION OR PACKAGE_FIND_VERSION VERSION_LESS "1.11")
add_library(pugixml INTERFACE IMPORTED) add_library(pugixml INTERFACE IMPORTED)
target_link_libraries(pugixml INTERFACE pugixml::pugixml) # Equivalent to target_link_libraries INTERFACE, but compatible with CMake 3.10
set_target_properties(pugixml PROPERTIES INTERFACE_LINK_LIBRARIES pugixml::pugixml)
endif () endif ()