jsoncpp/jsoncpp-namespaced-targets.cmake
Roelof Oomen fa0dff18fd
Protect target JsonCpp::JsonCpp against multi-include (#1435)
* Protect target JsonCpp::JsonCpp against multi-include

Fixes #1356

* Simplify (@BillyDonahue)

---------

Co-authored-by: Jordan Bayles <bayles.jordan@gmail.com>
2024-09-09 20:02:24 -07:00

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 ()