From 05e3c29ee43d56bcb0e5eaa2a1752cfbf78c51ec Mon Sep 17 00:00:00 2001 From: Scott Giese Date: Fri, 22 Jun 2018 22:19:49 -0500 Subject: [PATCH] Support Visual Studio 2017 --- CMakeLists.txt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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 )