From 30e69332799eda1f6067b60990938ac13a21a73e Mon Sep 17 00:00:00 2001 From: Levi Armstrong Date: Mon, 6 Nov 2023 08:48:29 -0600 Subject: [PATCH] Fix yaml-cpp-config.cmake.in --- yaml-cpp-config.cmake.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/yaml-cpp-config.cmake.in b/yaml-cpp-config.cmake.in index f71e13b..7f16f79 100644 --- a/yaml-cpp-config.cmake.in +++ b/yaml-cpp-config.cmake.in @@ -19,8 +19,11 @@ include("${CMAKE_CURRENT_LIST_DIR}/yaml-cpp-targets.cmake") # These are IMPORTED targets created by yaml-cpp-targets.cmake set(YAML_CPP_LIBRARIES "@EXPORT_TARGETS@") -add_library(yaml-cpp INTERFACE IMPORTED) -target_link_libraries(yaml-cpp INTERFACE yaml-cpp::yaml-cpp) +if(NOT TARGET yaml-cpp) + add_library(yaml-cpp INTERFACE IMPORTED) + target_link_libraries(yaml-cpp INTERFACE yaml-cpp::yaml-cpp) +endif() + if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.17) set_target_properties(yaml-cpp PROPERTIES DEPRECATION "The target yaml-cpp is deprecated and will be removed in version 0.10.0. Use the yaml-cpp::yaml-cpp target instead."