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 chain
This commit is contained in:
RichardTea
2019-04-17 09:32:24 +01:00
parent 4507f7cf46
commit 836801d37e
2 changed files with 24 additions and 12 deletions
+7
View File
@@ -1037,6 +1037,10 @@ ENDIF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
if( MSVC )
# 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 )
set(MSVC_PREFIX "vc70")
elseif( MSVC80 )
@@ -1051,9 +1055,12 @@ if( MSVC )
set(MSVC_PREFIX "vc120")
elseif( MSVC14 )
set(MSVC_PREFIX "vc140")
elseif( MSVC15 )
set(MSVC_PREFIX "vc141")
else()
set(MSVC_PREFIX "vc150")
endif()
endif()
set(LIBRARY_SUFFIX "${ASSIMP_LIBRARY_SUFFIX}-${MSVC_PREFIX}-mt" CACHE STRING "the suffix for the assimp windows library")
endif()