diff --git a/adm/cmake/3rdparty_macro.cmake b/adm/cmake/3rdparty_macro.cmake index ac8a0ea729..202ee0ac2c 100644 --- a/adm/cmake/3rdparty_macro.cmake +++ b/adm/cmake/3rdparty_macro.cmake @@ -373,16 +373,17 @@ macro(CONFIGURE_DRACO_DEPS) else() set (USED_LIB_DEBUG ${3RDPARTY_DRACO_LIBRARY}) endif() - set (USED_LIB_CONF) - if (EXISTS ${USED_LIB_DEBUG}) - set (USED_LIB_CONF "$<$:${USED_LIB_DEBUG}>;${USED_LIB_CONF}") - endif() - if (EXISTS ${USED_LIB_RELEASE}) - set (USED_LIB_CONF "$<$:${USED_LIB_RELEASE}>;${USED_LIB_CONF}") - set (USED_LIB_CONF "$<$:${USED_LIB_RELEASE}>;${USED_LIB_CONF}") + + # Extract paths + get_filename_component(LIB_DEBUG_PATH ${USED_LIB_DEBUG} PATH) + get_filename_component(LIB_RELEASE_PATH ${USED_LIB_RELEASE} PATH) + + # Add library directories + if (EXISTS ${LIB_DEBUG_PATH}) + target_link_directories(${PROJECT_NAME} PRIVATE "$<$:${LIB_DEBUG_PATH}>") endif() - if (DEFINED USED_LIB_CONF) - set_property (TARGET ${PROJECT_NAME} APPEND PROPERTY LINK_LIBRARIES "${USED_LIB_CONF}") + if (EXISTS ${LIB_RELEASE_PATH}) + target_link_directories(${PROJECT_NAME} PRIVATE "$<$:${LIB_RELEASE_PATH}>;$<$:${LIB_RELEASE_PATH}>") endif() endif() endmacro()