summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2022-08-21 09:40:57 +0400
committerBrad King <brad.king@kitware.com>2022-09-22 10:21:39 -0400
commitdf8ad72ffa7c193638a7a086284bc455cccc5b5f (patch)
treeb7648c79941d7e0935395fc51aa8266b13e48dbc
parenteeebf31e54a04eee7a2a91bf80fce5a8fbae7e67 (diff)
downloadcmake-df8ad72ffa7c193638a7a086284bc455cccc5b5f.tar.gz
Build: Use imported target `kwiml::kwiml` instead of variables
-rw-r--r--Source/CMakeLists.txt2
-rw-r--r--Source/Modules/CMakeBuildUtilities.cmake2
-rw-r--r--Utilities/cmjsoncpp/CMakeLists.txt2
3 files changed, 2 insertions, 4 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 2c5af7bce5..cea16ec7bd 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -757,7 +757,7 @@ target_link_libraries(
JsonCpp::JsonCpp
LibUV::LibUV
LibRHash::LibRHash
- ${CMake_KWIML_LIBRARIES}
+ $<TARGET_NAME_IF_EXISTS:kwiml::kwiml>
${CMAKE_THREAD_LIBS_INIT}
)
diff --git a/Source/Modules/CMakeBuildUtilities.cmake b/Source/Modules/CMakeBuildUtilities.cmake
index e420c67916..5cfb0e76ea 100644
--- a/Source/Modules/CMakeBuildUtilities.cmake
+++ b/Source/Modules/CMakeBuildUtilities.cmake
@@ -90,9 +90,7 @@ if(CMAKE_USE_SYSTEM_KWIML)
if(NOT KWIML_FOUND)
message(FATAL_ERROR "CMAKE_USE_SYSTEM_KWIML is ON but KWIML is not found!")
endif()
- set(CMake_KWIML_LIBRARIES kwiml::kwiml)
else()
- set(CMake_KWIML_LIBRARIES "")
if(BUILD_TESTING)
set(KWIML_TEST_ENABLE 1)
endif()
diff --git a/Utilities/cmjsoncpp/CMakeLists.txt b/Utilities/cmjsoncpp/CMakeLists.txt
index c384f4e1e5..09579d2c33 100644
--- a/Utilities/cmjsoncpp/CMakeLists.txt
+++ b/Utilities/cmjsoncpp/CMakeLists.txt
@@ -21,5 +21,5 @@ include_directories(
)
add_library(cmjsoncpp ${JSONCPP_SOURCES})
-target_link_libraries(cmjsoncpp ${CMake_KWIML_LIBRARIES})
+target_link_libraries(cmjsoncpp $<TARGET_NAME_IF_EXISTS:kwiml::kwiml>)
set_property(TARGET cmjsoncpp PROPERTY CXX_INCLUDE_WHAT_YOU_USE "")