Define CMAKE_DEBUG_POSTFIX and use it instead of ASSIMP_DEBUG_PREFIX
to have a consistent library name accross platforms.pull/452/head
parent
e2a33e726d
commit
a94e668486
|
@ -48,7 +48,7 @@ set(ASSIMP_LIBRARY_SUFFIX "" CACHE STRING "Suffix to append to library names")
|
|||
option(ASSIMP_ANDROID_JNIIOSYSTEM "Android JNI IOSystem support is active" OFF)
|
||||
|
||||
# Workaround to be able to deal with compiler bug "Too many sections" with mingw.
|
||||
if( CMAKE_COMPILER_IS_MINGW )
|
||||
if( CMAKE_COMPILER_IS_MINGW )
|
||||
ADD_DEFINITIONS(-DASSIMP_BUILD_NO_IFC_IMPORTER )
|
||||
endif()
|
||||
|
||||
|
@ -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 )
|
||||
|
@ -108,7 +108,7 @@ IF ( ASSIMP_ENABLE_BOOST_WORKAROUND )
|
|||
MESSAGE( STATUS "Building a non-boost version of Assimp." )
|
||||
ELSE ( ASSIMP_ENABLE_BOOST_WORKAROUND )
|
||||
SET( Boost_DETAILED_FAILURE_MSG ON )
|
||||
SET( Boost_ADDITIONAL_VERSIONS "1.47" "1.47.0" "1.48.0" "1.48" "1.49" "1.49.0" "1.50" "1.50.0" "1.51" "1.51.0" "1.52.0" "1.53.0" "1.54.0" "1.55" "1.55.0" "1.56" "1.56.0" "1.57" "1.57.0" )
|
||||
SET( Boost_ADDITIONAL_VERSIONS "1.47" "1.47.0" "1.48.0" "1.48" "1.49" "1.49.0" "1.50" "1.50.0" "1.51" "1.51.0" "1.52.0" "1.53.0" "1.54.0" "1.55" "1.55.0" "1.56" "1.56.0" "1.57" "1.57.0" )
|
||||
FIND_PACKAGE( Boost )
|
||||
IF ( NOT Boost_FOUND )
|
||||
MESSAGE( FATAL_ERROR
|
||||
|
@ -164,7 +164,7 @@ IF ( ASSIMP_NO_EXPORT )
|
|||
MESSAGE( STATUS "Build an import-only version of Assimp." )
|
||||
ENDIF( ASSIMP_NO_EXPORT )
|
||||
|
||||
SET ( ASSIMP_BUILD_ARCHITECTURE "" CACHE STRING
|
||||
SET ( ASSIMP_BUILD_ARCHITECTURE "" CACHE STRING
|
||||
"describe the current architecture."
|
||||
)
|
||||
IF ( ASSIMP_BUILD_ARCHITECTURE STREQUAL "")
|
||||
|
@ -173,7 +173,7 @@ ELSE ( ASSIMP_BUILD_ARCHITECTURE STREQUAL "")
|
|||
ENDIF ( ASSIMP_BUILD_ARCHITECTURE STREQUAL "")
|
||||
|
||||
# ${CMAKE_GENERATOR}
|
||||
SET ( ASSIMP_BUILD_COMPILER "" CACHE STRING
|
||||
SET ( ASSIMP_BUILD_COMPILER "" CACHE STRING
|
||||
"describe the current compiler."
|
||||
)
|
||||
IF ( ASSIMP_BUILD_COMPILER STREQUAL "")
|
||||
|
@ -211,7 +211,7 @@ option ( ASSIMP_BUILD_TESTS
|
|||
"If the test suite for Assimp is built in addition to the library."
|
||||
ON
|
||||
)
|
||||
|
||||
|
||||
IF ( ASSIMP_BUILD_TESTS )
|
||||
ADD_SUBDIRECTORY( test/ )
|
||||
ENDIF ( ASSIMP_BUILD_TESTS )
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -205,7 +205,7 @@ SET( Collada_SRCS
|
|||
ColladaParser.cpp
|
||||
ColladaParser.h
|
||||
ColladaExporter.h
|
||||
ColladaExporter.cpp
|
||||
ColladaExporter.cpp
|
||||
)
|
||||
SOURCE_GROUP( Collada FILES ${Collada_SRCS})
|
||||
|
||||
|
@ -332,7 +332,7 @@ SET( Obj_SRCS
|
|||
ObjFileParser.cpp
|
||||
ObjFileParser.h
|
||||
ObjTools.h
|
||||
|
||||
|
||||
ObjExporter.h
|
||||
ObjExporter.cpp
|
||||
)
|
||||
|
@ -596,14 +596,14 @@ SET( ConvertUTF_SRCS
|
|||
)
|
||||
SOURCE_GROUP( ConvertUTF FILES ${ConvertUTF_SRCS})
|
||||
|
||||
SET( Clipper_SRCS
|
||||
SET( Clipper_SRCS
|
||||
../contrib/clipper/clipper.hpp
|
||||
../contrib/clipper/clipper.cpp
|
||||
)
|
||||
SOURCE_GROUP( Clipper FILES ${Clipper_SRCS})
|
||||
|
||||
|
||||
SET( Poly2Tri_SRCS
|
||||
SET( Poly2Tri_SRCS
|
||||
../contrib/poly2tri/poly2tri/common/shapes.cc
|
||||
../contrib/poly2tri/poly2tri/common/shapes.h
|
||||
../contrib/poly2tri/poly2tri/common/utils.h
|
||||
|
@ -699,7 +699,7 @@ SET( assimp_src
|
|||
${IFC_SRCS}
|
||||
${XGL_SRCS}
|
||||
${FBX_SRCS}
|
||||
|
||||
|
||||
# Third-party libraries
|
||||
${IrrXML_SRCS}
|
||||
${ConvertUTF_SRCS}
|
||||
|
@ -711,7 +711,7 @@ SET( assimp_src
|
|||
|
||||
${PUBLIC_HEADERS}
|
||||
${COMPILER_HEADERS}
|
||||
|
||||
|
||||
# Old precompiled header
|
||||
# (removed because the precompiled header is not updated when visual studio switch configuration which leads to failed compilation.
|
||||
# Moreover it's a drag to recompile assimp entirely each time a modification is made to one of the included header, which is definitely counter-productive.)
|
||||
|
@ -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}
|
||||
SOVERSION ${ASSIMP_SOVERSION} # use full version
|
||||
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
|
||||
)
|
||||
|
|
|
@ -19,16 +19,16 @@ INCLUDE_DIRECTORIES(
|
|||
${GLUT_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
LINK_DIRECTORIES(
|
||||
${Assimp_BINARY_DIR}
|
||||
${Assimp_BINARY_DIR}/lib
|
||||
LINK_DIRECTORIES(
|
||||
${Assimp_BINARY_DIR}
|
||||
${Assimp_BINARY_DIR}/lib
|
||||
)
|
||||
|
||||
ADD_EXECUTABLE( assimp_simpleogl
|
||||
Sample_SimpleOpenGL.c
|
||||
)
|
||||
|
||||
SET_PROPERTY(TARGET assimp_simpleogl PROPERTY DEBUG_POSTFIX ${ASSIMP_DEBUG_POSTFIX})
|
||||
SET_PROPERTY(TARGET assimp_simpleogl PROPERTY DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
|
||||
|
||||
TARGET_LINK_LIBRARIES( assimp_simpleogl assimp ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${M_LIB} )
|
||||
SET_TARGET_PROPERTIES( assimp_simpleogl PROPERTIES
|
||||
|
@ -37,4 +37,4 @@ SET_TARGET_PROPERTIES( assimp_simpleogl PROPERTIES
|
|||
|
||||
INSTALL( TARGETS assimp_simpleogl
|
||||
DESTINATION "${ASSIMP_BIN_INSTALL_DIR}" COMPONENT assimp-dev
|
||||
)
|
||||
)
|
||||
|
|
|
@ -19,8 +19,8 @@ INCLUDE_DIRECTORIES(
|
|||
${Assimp_SOURCE_DIR}/samples/DevIL/include/
|
||||
)
|
||||
|
||||
LINK_DIRECTORIES(
|
||||
${Assimp_BINARY_DIR}
|
||||
LINK_DIRECTORIES(
|
||||
${Assimp_BINARY_DIR}
|
||||
${Assimp_BINARY_DIR}/lib/
|
||||
${Assimp_SOURCE_DIR}/samples/DevIL/lib/
|
||||
)
|
||||
|
@ -30,7 +30,7 @@ ADD_EXECUTABLE( assimp_simpletexturedogl WIN32
|
|||
SimpleTexturedOpenGL/src/model_loading.cpp
|
||||
)
|
||||
|
||||
SET_PROPERTY(TARGET assimp_simpletexturedogl PROPERTY DEBUG_POSTFIX ${ASSIMP_DEBUG_POSTFIX})
|
||||
SET_PROPERTY(TARGET assimp_simpletexturedogl PROPERTY DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
|
||||
|
||||
TARGET_LINK_LIBRARIES( assimp_simpletexturedogl assimp ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} DevIL.lib )
|
||||
|
||||
|
@ -40,4 +40,4 @@ SET_TARGET_PROPERTIES( assimp_simpletexturedogl PROPERTIES
|
|||
|
||||
INSTALL( TARGETS assimp_simpletexturedogl
|
||||
DESTINATION "${ASSIMP_BIN_INSTALL_DIR}" COMPONENT assimp-dev
|
||||
)
|
||||
)
|
||||
|
|
|
@ -52,7 +52,7 @@ add_executable( unit
|
|||
${TEST_SRCS}
|
||||
)
|
||||
|
||||
SET_PROPERTY( TARGET assimp PROPERTY DEBUG_POSTFIX ${ASSIMP_DEBUG_POSTFIX} )
|
||||
SET_PROPERTY( TARGET assimp PROPERTY DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX} )
|
||||
|
||||
add_dependencies( unit gtest )
|
||||
target_link_libraries( unit assimp
|
||||
|
|
|
@ -19,7 +19,7 @@ ADD_EXECUTABLE( assimp_cmd
|
|||
Export.cpp
|
||||
)
|
||||
|
||||
SET_PROPERTY(TARGET assimp_cmd PROPERTY DEBUG_POSTFIX ${ASSIMP_DEBUG_POSTFIX})
|
||||
SET_PROPERTY(TARGET assimp_cmd PROPERTY DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
|
||||
|
||||
IF( WIN32 )
|
||||
ADD_CUSTOM_COMMAND(TARGET assimp_cmd
|
||||
|
@ -35,4 +35,4 @@ SET_TARGET_PROPERTIES( assimp_cmd PROPERTIES
|
|||
|
||||
INSTALL( TARGETS assimp_cmd
|
||||
DESTINATION "${ASSIMP_BIN_INSTALL_DIR}" COMPONENT assimp-bin
|
||||
)
|
||||
)
|
||||
|
|
|
@ -42,7 +42,7 @@ ADD_EXECUTABLE( assimp_viewer WIN32
|
|||
txi.bmp
|
||||
)
|
||||
|
||||
SET_PROPERTY(TARGET assimp_viewer PROPERTY DEBUG_POSTFIX ${ASSIMP_DEBUG_POSTFIX})
|
||||
SET_PROPERTY(TARGET assimp_viewer PROPERTY DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
|
||||
|
||||
|
||||
IF ( MSVC )
|
||||
|
@ -52,7 +52,7 @@ ENDIF ( MSVC )
|
|||
|
||||
|
||||
#
|
||||
ADD_CUSTOM_COMMAND(TARGET assimp_viewer
|
||||
ADD_CUSTOM_COMMAND(TARGET assimp_viewer
|
||||
PRE_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:assimp> $<TARGET_FILE_DIR:assimp_viewer>
|
||||
MAIN_DEPENDENCY assimp)
|
||||
|
|
Loading…
Reference in New Issue