diff options
author | Alex Turbov <i.zaufi@gmail.com> | 2016-06-03 06:29:42 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-06-03 15:11:38 (GMT) |
commit | 3720d5f4a3c6edfdb1533ac60c9ade0adee92e09 (patch) | |
tree | d262edf10763ab7ab62aff1ec7002534cb4c9910 | |
parent | cf12e4abcd7e2b6af8a6232197f7c1f3b6e53d50 (diff) | |
download | CMake-3720d5f4a3c6edfdb1533ac60c9ade0adee92e09.zip CMake-3720d5f4a3c6edfdb1533ac60c9ade0adee92e09.tar.gz CMake-3720d5f4a3c6edfdb1533ac60c9ade0adee92e09.tar.bz2 |
FindBoost: Test `CMAKE_CXX_COMPILER_{ID,VERSION}` instead of `MSVC*`
-rw-r--r-- | Modules/FindBoost.cmake | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 67d71d0..25840b3 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -442,24 +442,26 @@ function(_Boost_GUESS_COMPILER_PREFIX _ret) endif() elseif (GHSMULTI) set(_boost_COMPILER "-ghs") - elseif (MSVC14) - set(_boost_COMPILER "-vc140") - elseif (MSVC12) - set(_boost_COMPILER "-vc120") - elseif (MSVC11) - set(_boost_COMPILER "-vc110") - elseif (MSVC10) - set(_boost_COMPILER "-vc100") - elseif (MSVC90) - set(_boost_COMPILER "-vc90") - elseif (MSVC80) - set(_boost_COMPILER "-vc80") - elseif (MSVC71) - set(_boost_COMPILER "-vc71") - elseif (MSVC70) # Good luck! - set(_boost_COMPILER "-vc7") # yes, this is correct - elseif (MSVC60) # Good luck! - set(_boost_COMPILER "-vc6") # yes, this is correct + elseif("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19) + set(_boost_COMPILER "-vc140") + elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18) + set(_boost_COMPILER "-vc120") + elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17) + set(_boost_COMPILER "-vc110") + elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16) + set(_boost_COMPILER "-vc100") + elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15) + set(_boost_COMPILER "-vc90") + elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14) + set(_boost_COMPILER "-vc80") + elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.10) + set(_boost_COMPILER "-vc71") + elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13) # Good luck! + set(_boost_COMPILER "-vc7") # yes, this is correct + else() # MSVC60 Good luck! + set(_boost_COMPILER "-vc6") # yes, this is correct + endif() elseif (BORLAND) set(_boost_COMPILER "-bcb") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") @@ -1261,7 +1263,8 @@ endif() # g using debug versions of the standard and runtime # support libraries 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") set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}g") endif() |