Skip to content

Commit 30e6933

Browse files
Levi-Armstrongjbeder
authored andcommitted
Fix yaml-cpp-config.cmake.in
1 parent db03655 commit 30e6933

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

yaml-cpp-config.cmake.in

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ include("${CMAKE_CURRENT_LIST_DIR}/yaml-cpp-targets.cmake")
1919
# These are IMPORTED targets created by yaml-cpp-targets.cmake
2020
set(YAML_CPP_LIBRARIES "@EXPORT_TARGETS@")
2121

22-
add_library(yaml-cpp INTERFACE IMPORTED)
23-
target_link_libraries(yaml-cpp INTERFACE yaml-cpp::yaml-cpp)
22+
if(NOT TARGET yaml-cpp)
23+
add_library(yaml-cpp INTERFACE IMPORTED)
24+
target_link_libraries(yaml-cpp INTERFACE yaml-cpp::yaml-cpp)
25+
endif()
26+
2427
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.17)
2528
set_target_properties(yaml-cpp PROPERTIES
2629
DEPRECATION "The target yaml-cpp is deprecated and will be removed in version 0.10.0. Use the yaml-cpp::yaml-cpp target instead."

0 commit comments

Comments
 (0)