CMake updates for VS2015/cmake 3.12 onwards
cmake 3.12 adds MSVC_TOOLSET_VERSION to define the version of MSVC toolchain in use Use that if present instead of if-elseif chainpull/2417/head
parent
4507f7cf46
commit
836801d37e
|
@ -106,7 +106,7 @@ OPTION ( BUILD_DOCS
|
||||||
OFF
|
OFF
|
||||||
)
|
)
|
||||||
OPTION( INJECT_DEBUG_POSTFIX
|
OPTION( INJECT_DEBUG_POSTFIX
|
||||||
"Inject debug postfix in .a/.so lib names"
|
"Inject debug postfix in .a/.so/.dll lib names"
|
||||||
ON
|
ON
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -127,14 +127,15 @@ if (WIN32)
|
||||||
ADD_DEFINITIONS( -DWIN32_LEAN_AND_MEAN )
|
ADD_DEFINITIONS( -DWIN32_LEAN_AND_MEAN )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
IF(MSVC)
|
IF(MSVC)
|
||||||
OPTION( ASSIMP_INSTALL_PDB
|
OPTION( ASSIMP_INSTALL_PDB
|
||||||
"Install MSVC debug files."
|
"Install MSVC debug files."
|
||||||
ON
|
ON
|
||||||
)
|
)
|
||||||
# Multibyte character set is deprecated, but default
|
IF(NOT (MSVC_VERSION LESS 1900))
|
||||||
ADD_DEFINITIONS( -DUNICODE -D_UNICODE )
|
# Multibyte character set is deprecated since at least MSVC2015 (possibly earlier)
|
||||||
|
ADD_DEFINITIONS( -DUNICODE -D_UNICODE )
|
||||||
|
ENDIF()
|
||||||
ENDIF(MSVC)
|
ENDIF(MSVC)
|
||||||
|
|
||||||
IF (BUILD_FRAMEWORK)
|
IF (BUILD_FRAMEWORK)
|
||||||
|
@ -545,18 +546,22 @@ if(WIN32)
|
||||||
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
SET(BIN_DIR "${PROJECT_SOURCE_DIR}/bin64/")
|
SET(BIN_DIR "${PROJECT_SOURCE_DIR}/bin64/")
|
||||||
SET(LIB_DIR "${PROJECT_SOURCE_DIR}/lib64/")
|
SET(LIB_DIR "${PROJECT_SOURCE_DIR}/lib64/")
|
||||||
elseif()
|
else()
|
||||||
SET(BIN_DIR "${PROJECT_SOURCE_DIR}/bin32/")
|
SET(BIN_DIR "${PROJECT_SOURCE_DIR}/bin32/")
|
||||||
SET(LIB_DIR "${PROJECT_SOURCE_DIR}/lib32/")
|
SET(LIB_DIR "${PROJECT_SOURCE_DIR}/lib32/")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(MSVC12)
|
IF(MSVC_TOOLSET_VERSION)
|
||||||
SET(ASSIMP_MSVC_VERSION "vc120")
|
set(MSVC_PREFIX "vc${MSVC_TOOLSET_VERSION}")
|
||||||
ELSEIF(MSVC14)
|
ELSE()
|
||||||
SET(ASSIMP_MSVC_VERSION "vc140")
|
IF(MSVC12)
|
||||||
ELSEIF(MSVC15)
|
SET(ASSIMP_MSVC_VERSION "vc120")
|
||||||
SET(ASSIMP_MSVC_VERSION "vc141")
|
ELSEIF(MSVC14)
|
||||||
ENDIF(MSVC12)
|
SET(ASSIMP_MSVC_VERSION "vc140")
|
||||||
|
ELSEIF(MSVC15)
|
||||||
|
SET(ASSIMP_MSVC_VERSION "vc141")
|
||||||
|
ENDIF(MSVC12)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
IF(MSVC12 OR MSVC14 OR MSVC15 )
|
IF(MSVC12 OR MSVC14 OR MSVC15 )
|
||||||
ADD_CUSTOM_TARGET(UpdateAssimpLibsDebugSymbolsAndDLLs COMMENT "Copying Assimp Libraries ..." VERBATIM)
|
ADD_CUSTOM_TARGET(UpdateAssimpLibsDebugSymbolsAndDLLs COMMENT "Copying Assimp Libraries ..." VERBATIM)
|
||||||
|
|
|
@ -1037,6 +1037,10 @@ ENDIF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
|
||||||
|
|
||||||
if( MSVC )
|
if( MSVC )
|
||||||
# in order to prevent DLL hell, each of the DLLs have to be suffixed with the major version and msvc prefix
|
# in order to prevent DLL hell, each of the DLLs have to be suffixed with the major version and msvc prefix
|
||||||
|
# CMake 3.12 added a variable for this
|
||||||
|
if(MSVC_TOOLSET_VERSION)
|
||||||
|
set(MSVC_PREFIX "vc${MSVC_TOOLSET_VERSION}")
|
||||||
|
else()
|
||||||
if( MSVC70 OR MSVC71 )
|
if( MSVC70 OR MSVC71 )
|
||||||
set(MSVC_PREFIX "vc70")
|
set(MSVC_PREFIX "vc70")
|
||||||
elseif( MSVC80 )
|
elseif( MSVC80 )
|
||||||
|
@ -1051,9 +1055,12 @@ if( MSVC )
|
||||||
set(MSVC_PREFIX "vc120")
|
set(MSVC_PREFIX "vc120")
|
||||||
elseif( MSVC14 )
|
elseif( MSVC14 )
|
||||||
set(MSVC_PREFIX "vc140")
|
set(MSVC_PREFIX "vc140")
|
||||||
|
elseif( MSVC15 )
|
||||||
|
set(MSVC_PREFIX "vc141")
|
||||||
else()
|
else()
|
||||||
set(MSVC_PREFIX "vc150")
|
set(MSVC_PREFIX "vc150")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
set(LIBRARY_SUFFIX "${ASSIMP_LIBRARY_SUFFIX}-${MSVC_PREFIX}-mt" CACHE STRING "the suffix for the assimp windows library")
|
set(LIBRARY_SUFFIX "${ASSIMP_LIBRARY_SUFFIX}-${MSVC_PREFIX}-mt" CACHE STRING "the suffix for the assimp windows library")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue