Build: Use imported target JsonCpp::JsonCpp instead of variables

This commit is contained in:
Alex Turbov
2022-08-21 09:22:59 +04:00
committed by Brad King
parent ac76c53d33
commit ddac6dcbe8
2 changed files with 2 additions and 3 deletions

View File

@@ -754,7 +754,7 @@ target_link_libraries(
EXPAT::EXPAT
LibArchive::LibArchive
ZLIB::ZLIB
${CMAKE_JSONCPP_LIBRARIES}
JsonCpp::JsonCpp
${CMAKE_LIBUV_LIBRARIES}
${CMAKE_LIBRHASH_LIBRARIES}
${CMake_KWIML_LIBRARIES}

View File

@@ -318,10 +318,9 @@ if(CMAKE_USE_SYSTEM_JSONCPP)
set_property(TARGET JsonCpp::JsonCpp APPEND PROPERTY
INTERFACE_COMPILE_OPTIONS -Wno-deprecated-declarations)
endif()
set(CMAKE_JSONCPP_LIBRARIES JsonCpp::JsonCpp)
else()
set(CMAKE_JSONCPP_LIBRARIES cmjsoncpp)
add_subdirectory(Utilities/cmjsoncpp)
add_library(JsonCpp::JsonCpp ALIAS cmjsoncpp)
CMAKE_SET_TARGET_FOLDER(cmjsoncpp "Utilities/3rdParty")
endif()