diff options
author | Basil Fierz <basil.fierz@hotmail.com> | 2018-05-19 11:23:21 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-05-29 14:12:59 (GMT) |
commit | 5f1316841944198037d6463d3ddd12efcfae45b3 (patch) | |
tree | 3a58c25a578caa6813fa66efcc18eac968991368 /Modules/CMakeDetermineCompilerId.cmake | |
parent | a543a233a280f23e72ce5ff7d7a00239bd8634fb (diff) | |
download | CMake-5f1316841944198037d6463d3ddd12efcfae45b3.zip CMake-5f1316841944198037d6463d3ddd12efcfae45b3.tar.gz CMake-5f1316841944198037d6463d3ddd12efcfae45b3.tar.bz2 |
VS: Add option to select the version of the toolset used by VS 2017
Add new `version=` parameter in the toolset setting to select the
version. Add variable `CMAKE_VS_PLATFORM_TOOLSET_VERSION` to hold the
version, if one is set (blank indicates default).
Fixes: #17549
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index ea5465a..1628203 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -213,9 +213,13 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "Intel") set(id_cl icl.exe) endif() + if(CMAKE_VS_PLATFORM_TOOLSET_VERSION) + set(id_toolset_version_props "<Import Project=\"${CMAKE_GENERATOR_INSTANCE}\\VC\\Auxiliary\\Build\\${CMAKE_VS_PLATFORM_TOOLSET_VERSION}\\Microsoft.VCToolsVersion.${CMAKE_VS_PLATFORM_TOOLSET_VERSION}.props\" />") + endif() endif() else() set(id_toolset "") + set(id_toolset_version_props "") endif() if(CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE) set(id_PreferredToolArchitecture "<PreferredToolArchitecture>${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE}</PreferredToolArchitecture>") |