diff --git a/CMakeLists.txt b/CMakeLists.txt index b728f990..02c7cd2d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -167,14 +167,22 @@ endif (MSVC) if (MSVC AND MSVC_3RDPARTY_ROOT) message(STATUS "3rdparty files located in ${MSVC_3RDPARTY_ROOT}") + string(SUBSTRING ${MSVC_VERSION} 0 2 MSVC_VERSION_MAJOR) + string(SUBSTRING ${MSVC_VERSION} 2 2 MSVC_VERSION_MINOR) + set( OSG_MSVC "msvc" ) - if (${MSVC_VERSION} EQUAL 1900) + if (${MSVC_VERSION_MAJOR} EQUAL "19") + if (${MSVC_VERSION_MINOR} EQUAL "00") set( OSG_MSVC ${OSG_MSVC}140 ) - elseif (${MSVC_VERSION} EQUAL 1800) - set( OSG_MSVC ${OSG_MSVC}120 ) + else () + set( OSG_MSVC ${OSG_MSVC}141 ) + endif () + elseif (${MSVC_VERSION_MAJOR} EQUAL "18") + set( OSG_MSVC ${OSG_MSVC}120 ) else () - message(FATAL_ERROR "Visual Studio 2013/2015 is required now") + message(FATAL_ERROR "Visual Studio 2013/15/17 is required") endif () + if (CMAKE_CL_64) set( OSG_MSVC ${OSG_MSVC}-64 ) set( MSVC_3RDPARTY_DIR 3rdParty.x64 )