From e96788d5172158dd32b10f39f565d86cc60b62cb Mon Sep 17 00:00:00 2001 From: Rinat M Date: Tue, 25 Jun 2019 15:19:10 -0400 Subject: [PATCH] update MSVC cmake variables --- SuperBuild/External_Boost.cmake | 45 ++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/SuperBuild/External_Boost.cmake b/SuperBuild/External_Boost.cmake index f777622..6fe9c33 100644 --- a/SuperBuild/External_Boost.cmake +++ b/SuperBuild/External_Boost.cmake @@ -59,28 +59,34 @@ if(NOT ( DEFINED "USE_SYSTEM_${extProjName}" AND "${USE_SYSTEM_${extProjName}}" endif() endif() - if(MSVC10) - list(APPEND Boost_b2_Command toolset=msvc-10.0) - elseif(MSVC11) - list(APPEND Boost_b2_Command toolset=msvc-11.0) - elseif(MSVC12) - list(APPEND Boost_b2_Command toolset=msvc-12.0) - elseif(MSVC14) - list(APPEND Boost_b2_Command toolset=msvc-14.0) - elseif(XCODE_VERSION) - list(APPEND Boost_b2_Command toolset=clang) + if(NOT MSVC_VERSION VERSION_LESS 1400 AND MSVC_VERSION VERSION_LESS 1500) + list(APPEND Boost_b2_Command toolset=msvc-8.0) + elseif(NOT MSVC_VERSION VERSION_LESS 1500 AND MSVC_VERSION VERSION_LESS 1600) + list(APPEND Boost_b2_Command toolset=msvc-9.0) + elseif(NOT MSVC_VERSION VERSION_LESS 1600 AND MSVC_VERSION VERSION_LESS 1700) + list(APPEND Boost_b2_Command toolset=msvc-10.0) + elseif(NOT MSVC_VERSION VERSION_LESS 1700 AND MSVC_VERSION VERSION_LESS 1800) + list(APPEND Boost_b2_Command toolset=msvc-11.0) + elseif(NOT MSVC_VERSION VERSION_LESS 1800 AND MSVC_VERSION VERSION_LESS 1900) + list(APPEND Boost_b2_Command toolset=msvc-12.0) + elseif(NOT MSVC_VERSION VERSION_LESS 1900 AND MSVC_VERSION VERSION_LESS 1910) + list(APPEND Boost_b2_Command toolset=msvc-14.0) + elseif(NOT MSVC_VERSION VERSION_LESS 1910 AND MSVC_VERSION VERSION_LESS 1920) + list(APPEND Boost_b2_Command toolset=msvc-14.1) elseif(ENV{CC}) # CMake apprarently puts the full path of the compiler into CC # The user might specify a non-default gcc compiler through ENV - message(STATUS "ENV{CC}=$ENV{CC}") - get_filename_component( gccToolset "$ENV{CC}" NAME ) - - # see: https://svn.boost.org/trac/boost/ticket/5917 - string(TOLOWER ${gccToolset} gccToolset) - if(gccToolset STREQUAL "cc") - set(gccToolset "gcc") - endif() - list(APPEND Boost_b2_Command toolset=${gccToolset}) + message(STATUS "ENV{CC}=$ENV{CC}") + get_filename_component( gccToolset "$ENV{CC}" NAME ) + + # see: https://svn.boost.org/trac/boost/ticket/5917 + string(TOLOWER ${gccToolset} gccToolset) + if(gccToolset STREQUAL "cc") + set(gccToolset "gcc") + endif() + list(APPEND Boost_b2_Command toolset=${gccToolset}) + else() + message(FATAL_ERROR "Unknown MSVC compiler version [${MSVC_VERSION}]") endif() if(CMAKE_SIZEOF_VOID_P EQUAL 8) @@ -126,4 +132,3 @@ mark_as_superbuild( LABELS "FIND_PACKAGE" ) -