mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-08-08 04:26:24 -04:00

In jsoncpp-namspaced-targets.cmake, it creates JsonCpp::JsonCpp imported library without first checking whether it was already created by former call to find_package(JsonCpp). As CMake allows repeated call to find_package(), the error of "another target with the same name already exists" should be fixed.
10 lines
431 B
CMake
10 lines
431 B
CMake
if (NOT TARGET JsonCpp::JsonCpp)
|
|
if (TARGET jsoncpp_static)
|
|
add_library(JsonCpp::JsonCpp INTERFACE IMPORTED)
|
|
set_target_properties(JsonCpp::JsonCpp PROPERTIES INTERFACE_LINK_LIBRARIES "jsoncpp_static")
|
|
elseif (TARGET jsoncpp_lib)
|
|
add_library(JsonCpp::JsonCpp INTERFACE IMPORTED)
|
|
set_target_properties(JsonCpp::JsonCpp PROPERTIES INTERFACE_LINK_LIBRARIES "jsoncpp_lib")
|
|
endif ()
|
|
endif ()
|