summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorBasil Fierz <basil.fierz@hotmail.com>2018-05-19 13:23:21 +0200
committerBrad King <brad.king@kitware.com>2018-05-29 10:12:59 -0400
commit5f1316841944198037d6463d3ddd12efcfae45b3 (patch)
tree3a58c25a578caa6813fa66efcc18eac968991368 /Modules
parenta543a233a280f23e72ce5ff7d7a00239bd8634fb (diff)
downloadcmake-5f1316841944198037d6463d3ddd12efcfae45b3.tar.gz
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')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake4
-rw-r--r--Modules/CompilerId/VS-10.vcxproj.in1
2 files changed, 5 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index ea5465a8e4..1628203ecc 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>")
diff --git a/Modules/CompilerId/VS-10.vcxproj.in b/Modules/CompilerId/VS-10.vcxproj.in
index 6b9b361cc0..32c4ffcc44 100644
--- a/Modules/CompilerId/VS-10.vcxproj.in
+++ b/Modules/CompilerId/VS-10.vcxproj.in
@@ -15,6 +15,7 @@
@id_WindowsTargetPlatformVersion@
@id_WindowsSDKDesktopARMSupport@
</PropertyGroup>
+ @id_toolset_version_props@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup>
@id_PreferredToolArchitecture@