Skip to content

Commit

Permalink
Configuration - Debug Draco linking issue #197
Browse files Browse the repository at this point in the history
Refactor Draco dependency configuration to improve clarity and functionality
  • Loading branch information
dpasukhi committed Dec 15, 2024
1 parent 007992d commit c3e03ed
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions adm/cmake/3rdparty_macro.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$<$<CONFIG:DEBUG>:${USED_LIB_DEBUG}>;${USED_LIB_CONF}")
endif()
if (EXISTS ${USED_LIB_RELEASE})
set (USED_LIB_CONF "$<$<CONFIG:RELEASE>:${USED_LIB_RELEASE}>;${USED_LIB_CONF}")
set (USED_LIB_CONF "$<$<CONFIG:RELWITHDEBINFO>:${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 "$<$<CONFIG:DEBUG>:${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 "$<$<CONFIG:RELEASE>:${LIB_RELEASE_PATH}>;$<$<CONFIG:RELWITHDEBINFO>:${LIB_RELEASE_PATH}>")
endif()
endif()
endmacro()

0 comments on commit c3e03ed

Please sign in to comment.