diff options
author | Brad King <brad.king@kitware.com> | 2017-02-08 21:05:08 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-03-10 15:19:53 (GMT) |
commit | 5164e9a6510137eaac1c7b736a6b24fe02ce17a9 (patch) | |
tree | ef9e7554cb68377b3aebe09ae4e1265646f5f42c /Tests | |
parent | 83bf980c9601c2e5d6a6247867606539d8a14528 (diff) | |
download | CMake-5164e9a6510137eaac1c7b736a6b24fe02ce17a9.zip CMake-5164e9a6510137eaac1c7b736a6b24fe02ce17a9.tar.gz CMake-5164e9a6510137eaac1c7b736a6b24fe02ce17a9.tar.bz2 |
VS: Provide an option to specify CUDA toolset version
The NVIDIA CUDA Toolkit provides MSBuild toolset files for integration
with Visual Studio. Multiple versions may be installed so we need a way
to tell our VS generators which CUDA toolset to use. Extend the
`CMAKE_GENERATOR_TOOLSET` specification to provide a `cuda=...` field
specifying the version number.
Diffstat (limited to 'Tests')
5 files changed, 14 insertions, 0 deletions
diff --git a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake index 44c67a2..f6449f2 100644 --- a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake +++ b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake @@ -6,6 +6,12 @@ run_cmake(NoToolset) if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[01245]") set(RunCMake_GENERATOR_TOOLSET "Test Toolset") run_cmake(TestToolset) + set(RunCMake_GENERATOR_TOOLSET "Test Toolset,cuda=Test Cuda") + run_cmake(TestToolsetCudaBoth) + set(RunCMake_GENERATOR_TOOLSET ",cuda=Test Cuda") + run_cmake(TestToolsetCudaOnly) + set(RunCMake_GENERATOR_TOOLSET "cuda=Test Cuda") + run_cmake(TestToolsetCudaOnly) if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[245]") set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x64") run_cmake(TestToolsetHostArchBoth) diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetCudaBoth-stdout.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaBoth-stdout.txt new file mode 100644 index 0000000..90503e2 --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaBoth-stdout.txt @@ -0,0 +1,2 @@ +-- CMAKE_VS_PLATFORM_TOOLSET='Test Toolset' +-- CMAKE_VS_PLATFORM_TOOLSET_CUDA='Test Cuda' diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetCudaBoth.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaBoth.cmake new file mode 100644 index 0000000..befa0af --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaBoth.cmake @@ -0,0 +1,2 @@ +message(STATUS "CMAKE_VS_PLATFORM_TOOLSET='${CMAKE_VS_PLATFORM_TOOLSET}'") +message(STATUS "CMAKE_VS_PLATFORM_TOOLSET_CUDA='${CMAKE_VS_PLATFORM_TOOLSET_CUDA}'") diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetCudaOnly-stdout.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaOnly-stdout.txt new file mode 100644 index 0000000..94e1e43 --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaOnly-stdout.txt @@ -0,0 +1,2 @@ +-- CMAKE_VS_PLATFORM_TOOLSET='(v[0-9]+|Windows7.1SDK)' +-- CMAKE_VS_PLATFORM_TOOLSET_CUDA='Test Cuda' diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetCudaOnly.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaOnly.cmake new file mode 100644 index 0000000..befa0af --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaOnly.cmake @@ -0,0 +1,2 @@ +message(STATUS "CMAKE_VS_PLATFORM_TOOLSET='${CMAKE_VS_PLATFORM_TOOLSET}'") +message(STATUS "CMAKE_VS_PLATFORM_TOOLSET_CUDA='${CMAKE_VS_PLATFORM_TOOLSET_CUDA}'") |