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

This commit is contained in:
Alex Turbov 2022-08-21 09:40:57 +04:00 committed by Brad King
parent eeebf31e54
commit df8ad72ffa
3 changed files with 2 additions and 4 deletions

View File

@ -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}
)

View File

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

View File

@ -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 "")