FindBoost: Test CMAKE_CXX_COMPILER_{ID,VERSION} instead of MSVC*

This commit is contained in:
Alex Turbov 2016-06-03 13:29:42 +07:00 committed by Brad King
parent cf12e4abcd
commit 3720d5f4a3

View File

@ -442,24 +442,26 @@ function(_Boost_GUESS_COMPILER_PREFIX _ret)
endif() endif()
elseif (GHSMULTI) elseif (GHSMULTI)
set(_boost_COMPILER "-ghs") set(_boost_COMPILER "-ghs")
elseif (MSVC14) elseif("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
set(_boost_COMPILER "-vc140") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19)
elseif (MSVC12) set(_boost_COMPILER "-vc140")
set(_boost_COMPILER "-vc120") elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18)
elseif (MSVC11) set(_boost_COMPILER "-vc120")
set(_boost_COMPILER "-vc110") elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17)
elseif (MSVC10) set(_boost_COMPILER "-vc110")
set(_boost_COMPILER "-vc100") elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16)
elseif (MSVC90) set(_boost_COMPILER "-vc100")
set(_boost_COMPILER "-vc90") elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15)
elseif (MSVC80) set(_boost_COMPILER "-vc90")
set(_boost_COMPILER "-vc80") elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14)
elseif (MSVC71) set(_boost_COMPILER "-vc80")
set(_boost_COMPILER "-vc71") elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.10)
elseif (MSVC70) # Good luck! set(_boost_COMPILER "-vc71")
set(_boost_COMPILER "-vc7") # yes, this is correct elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13) # Good luck!
elseif (MSVC60) # Good luck! set(_boost_COMPILER "-vc7") # yes, this is correct
set(_boost_COMPILER "-vc6") # yes, this is correct else() # MSVC60 Good luck!
set(_boost_COMPILER "-vc6") # yes, this is correct
endif()
elseif (BORLAND) elseif (BORLAND)
set(_boost_COMPILER "-bcb") set(_boost_COMPILER "-bcb")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
@ -1261,7 +1263,8 @@ endif()
# g using debug versions of the standard and runtime # g using debug versions of the standard and runtime
# support libraries # support libraries
if(WIN32 AND Boost_USE_DEBUG_RUNTIME) if(WIN32 AND Boost_USE_DEBUG_RUNTIME)
if(MSVC OR "${CMAKE_CXX_COMPILER}" MATCHES "icl" if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC"
OR "${CMAKE_CXX_COMPILER}" MATCHES "icl"
OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc") OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc")
set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}g") set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}g")
endif() endif()