summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2022-08-21 05:22:59 (GMT)
committerBrad King <brad.king@kitware.com>2022-09-22 14:21:38 (GMT)
commitddac6dcbe8029a5850377ffb9aee088d9493e2ce (patch)
tree5b3863c495c81dda7f63ea850468ac73d927b208
parentac76c53d33e16a159d3152105e6f99f241769691 (diff)
downloadCMake-ddac6dcbe8029a5850377ffb9aee088d9493e2ce.zip
CMake-ddac6dcbe8029a5850377ffb9aee088d9493e2ce.tar.gz
CMake-ddac6dcbe8029a5850377ffb9aee088d9493e2ce.tar.bz2
Build: Use imported target `JsonCpp::JsonCpp` instead of variables
-rw-r--r--Source/CMakeLists.txt2
-rw-r--r--Source/Modules/CMakeBuildUtilities.cmake3
2 files changed, 2 insertions, 3 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index c8465a5..31d514d 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -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}
diff --git a/Source/Modules/CMakeBuildUtilities.cmake b/Source/Modules/CMakeBuildUtilities.cmake
index 51811d6..b17c7ce 100644
--- a/Source/Modules/CMakeBuildUtilities.cmake
+++ b/Source/Modules/CMakeBuildUtilities.cmake
@@ -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()