Skip to content
Snippets Groups Projects
Commit 9e8d864d authored by Christoph Pohl's avatar Christoph Pohl
Browse files

Add assimp_interface to the list of exported targets

The assimp_interface was implemented and added to the list of exported targets. This has been done to provide a cleaner and more encapsulated way of managing the assimp dependencies inside the VirtualRobot project. Now, instead of directly linking the assimp libraries to the VirtualRobot target, an interface library (assimp_interface) has been created to manage the assimp dependencies. This library is then linked to the VirtualRobot target. Additionally, install targets have been updated to include the assimp_interface.
parent 4b990e17
No related branches found
No related tags found
No related merge requests found
......@@ -230,7 +230,7 @@ list (APPEND Simox_LIBRARIES SimoxQtUtility)
#######################################################################################
if (Simox_BUILD_VirtualRobot)
add_subdirectory(VirtualRobot)
list(APPEND SIMOX_EXPORT_TARGET_LIST VirtualRobot)
list(APPEND SIMOX_EXPORT_TARGET_LIST VirtualRobot assimp_interface)
list(APPEND Simox_LIBRARIES VirtualRobot)
endif()
......
......@@ -37,10 +37,14 @@ endif ()
#### VISUALIZATION Coin3D+Qt+SoQt / OSG+Qt
find_package(assimp REQUIRED)
MESSAGE (STATUS "Found assimp: " ${ASSIMP_INCLUDE_DIRS})
target_link_libraries(VirtualRobot PUBLIC ${ASSIMP_LIBRARIES})
target_link_directories(VirtualRobot PUBLIC ${ASSIMP_LIBRARY_DIRS})
target_include_directories(VirtualRobot PUBLIC ${ASSIMP_INCLUDE_DIRS})
add_library(assimp_interface INTERFACE)
set_target_properties(assimp_interface PROPERTIES
INTERFACE_LINK_LIBRARIES "${ASSIMP_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${ASSIMP_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${ASSIMP_LIBRARY_DIRS}")
add_library(assimp::assimp ALIAS assimp_interface)
target_link_libraries(VirtualRobot PUBLIC assimp::assimp)
if (Simox_USE_COIN_VISUALIZATION)
MESSAGE(STATUS "Searching Coin3D, Qt and SoQt...")
......@@ -824,7 +828,7 @@ SET_TARGET_PROPERTIES(VirtualRobot PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${Simox_L
############################ Setup for installation ###################################
#######################################################################################
install(TARGETS VirtualRobot
install(TARGETS VirtualRobot assimp_interface
# IMPORTANT: Add the library to the "export-set"
EXPORT SimoxTargets
RUNTIME DESTINATION bin COMPONENT bin
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment