Define ASSIMP_LIBRARY_SUFFIX properly so cmake can find assimp it in windows.

pull/442/head
Ricardo Ortiz 2015-01-23 13:10:36 -05:00
parent e2a33e726d
commit c249ae7d43
3 changed files with 30 additions and 20 deletions

View File

@ -84,7 +84,7 @@ SET( ASSIMP_INCLUDE_INSTALL_DIR "include" CACHE PATH
SET( ASSIMP_BIN_INSTALL_DIR "bin" CACHE PATH
"Path the tool executables are installed to." )
SET(ASSIMP_DEBUG_POSTFIX "d" CACHE STRING "Debug Postfitx for lib, samples and tools")
SET(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Debug Postfitx for lib, samples and tools")
# Allow the user to build a shared or static library
option ( BUILD_SHARED_LIBS "Build a shared version of the library" ON )

View File

@ -40,9 +40,7 @@ set( ASSIMP_LINK_FLAGS "" )
set( ASSIMP_LIBRARY_DIRS "${ASSIMP_ROOT_DIR}/@ASSIMP_LIB_INSTALL_DIR@")
set( ASSIMP_INCLUDE_DIRS "${ASSIMP_ROOT_DIR}/@ASSIMP_INCLUDE_INSTALL_DIR@")
set( ASSIMP_LIBRARIES assimp${ASSIMP_LIBRARY_SUFFIX})
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set( ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES}@ASSIMP_DEBUG_POSTFIX@)
endif ()
set( ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES}@CMAKE_DEBUG_POSTFIX@)
# search for the boost version assimp was compiled with
#set(Boost_USE_MULTITHREAD ON)

View File

@ -722,8 +722,6 @@ SET( assimp_src
ADD_LIBRARY( assimp ${assimp_src} )
SET_PROPERTY(TARGET assimp PROPERTY DEBUG_POSTFIX ${ASSIMP_DEBUG_POSTFIX})
TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES})
if(ANDROID AND ASSIMP_ANDROID_JNIIOSYSTEM)
@ -732,10 +730,24 @@ if(ANDROID AND ASSIMP_ANDROID_JNIIOSYSTEM)
target_link_libraries(assimp android_jniiosystem)
endif(ANDROID AND ASSIMP_ANDROID_JNIIOSYSTEM)
if( MSVC )
# in order to prevent DLL hell, each of the DLLs have to be suffixed with the major version and msvc prefix
if( MSVC70 OR MSVC71 )
set(MSVC_PREFIX "vc70")
elseif( MSVC80 )
set(MSVC_PREFIX "vc80")
elseif( MSVC90 )
set(MSVC_PREFIX "vc90")
else()
set(MSVC_PREFIX "vc100")
endif()
set(LIBRARY_SUFFIX "${ASSIMP_LIBRARY_SUFFIX}-${MSVC_PREFIX}-mt" CACHE STRING "the suffix for the assimp windows library" FORCE)
endif()
SET_TARGET_PROPERTIES( assimp PROPERTIES
VERSION ${ASSIMP_VERSION}
SOVERSION ${ASSIMP_SOVERSION} # use full version
OUTPUT_NAME assimp${ASSIMP_LIBRARY_SUFFIX}
OUTPUT_NAME assimp${LIBRARY_SUFFIX}
)
if (APPLE)
@ -765,7 +777,7 @@ if (ASSIMP_ANDROID_JNIIOSYSTEM)
endif(ASSIMP_ANDROID_JNIIOSYSTEM)
if(MSVC AND ASSIMP_INSTALL_PDB)
install(FILES ${Assimp_BINARY_DIR}/code/Debug/assimp${ASSIMP_DEBUG_POSTFIX}.pdb
install(FILES ${Assimp_BINARY_DIR}/code/Debug/assimp${CMAKE_DEBUG_POSTFIX}.pdb
DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
CONFIGURATIONS Debug
)