Draco platform libraries have different names

On Windows it's draco.dll/lib
On Linux/macOS draco_shared.dylib & draco_static.lib
pull/3614/head
RichardTea 2021-01-26 17:18:15 +00:00
parent c917e6513f
commit fe97ff6474
2 changed files with 14 additions and 4 deletions

View File

@ -590,18 +590,28 @@ IF ( ASSIMP_BUILD_DRACO )
ENDIF()
ADD_SUBDIRECTORY( "contrib/draco" )
if(MSVC OR WIN32)
set(draco_LIBRARIES "draco")
else()
if(BUILD_SHARED_LIBS)
set(draco_LIBRARIES "draco_shared")
else()
set(draco_LIBRARIES "draco_static")
endif()
endif()
# Don't build the draco command-line tools by default
set_target_properties(draco_encoder draco_decoder PROPERTIES EXCLUDE_FROM_ALL TRUE)
set_target_properties(draco_encoder draco_decoder PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD TRUE)
TARGET_USE_COMMON_OUTPUT_DIRECTORY(draco)
TARGET_USE_COMMON_OUTPUT_DIRECTORY(${draco_LIBRARIES})
TARGET_USE_COMMON_OUTPUT_DIRECTORY(draco_encoder)
TARGET_USE_COMMON_OUTPUT_DIRECTORY(draco_decoder)
set(draco_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/contrib/draco/src")
# This is probably wrong
INSTALL( TARGETS draco
INSTALL( TARGETS ${draco_LIBRARIES}
EXPORT "${TARGETS_EXPORT_NAME}"
LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${ASSIMP_LIB_INSTALL_DIR}

View File

@ -1174,7 +1174,7 @@ IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
ENDIF ()
IF (ASSIMP_BUILD_DRACO)
target_link_libraries(assimp draco)
target_link_libraries(assimp ${draco_LIBRARIES})
ENDIF()
if( MSVC )