summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-10-21 13:21:12 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-10-21 13:21:24 (GMT)
commitfcab9785c91e1ac5f97eda63fef57c6683bcfb6b (patch)
tree38cf38ae5158ec8159d48cfd4857043caa9e1067 /Tests
parent52144401b904ab6f66376f7bae74aa307d975f21 (diff)
parent46e9ff57298b58b3a4669adcb913429b691ce5bb (diff)
downloadCMake-fcab9785c91e1ac5f97eda63fef57c6683bcfb6b.zip
CMake-fcab9785c91e1ac5f97eda63fef57c6683bcfb6b.tar.gz
CMake-fcab9785c91e1ac5f97eda63fef57c6683bcfb6b.tar.bz2
Merge topic 'vs-instance'
46e9ff5729 Restore honoring CMAKE_GENERATOR_INSTANCE in toolchain file 42418b02f7 Android: Refactor sysroot detection under Visual Studio 44a86d0b38 cmake_host_system_information: Add undocumented VS_MSBUILD_COMMAND key 6999b87133 cmGlobalVisualStudio10Generator: Add method to find MSBuild early 7f730464be cmGlobalGenerator: Add method to check if generator is at least VS 10 8917b8512f cmGlobalVisualStudioVersionedGenerator: Allow repeating SetGeneratorInstance 6511654164 cmGlobalVisualStudio10Generator: Allow subclasses to reset MSBuild search Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !6646
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/cmake_host_system_information/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/cmake_host_system_information/VsMSBuild.cmake4
-rw-r--r--Tests/RunCMake/cmake_host_system_information/VsMSBuildMissing-result.txt1
-rw-r--r--Tests/RunCMake/cmake_host_system_information/VsMSBuildMissing-stderr.txt4
-rw-r--r--Tests/RunCMake/cmake_host_system_information/VsMSBuildMissing.cmake1
5 files changed, 16 insertions, 0 deletions
diff --git a/Tests/RunCMake/cmake_host_system_information/RunCMakeTest.cmake b/Tests/RunCMake/cmake_host_system_information/RunCMakeTest.cmake
index 189013f..87b6944 100644
--- a/Tests/RunCMake/cmake_host_system_information/RunCMakeTest.cmake
+++ b/Tests/RunCMake/cmake_host_system_information/RunCMakeTest.cmake
@@ -15,3 +15,9 @@ run_cmake(CentOS6)
run_cmake(Debian6)
run_cmake(UserFallbackScript)
+
+if(RunCMake_GENERATOR MATCHES "^Visual Studio " AND NOT RunCMake_GENERATOR STREQUAL "Visual Studio 9 2008")
+ run_cmake(VsMSBuild)
+else()
+ run_cmake(VsMSBuildMissing)
+endif()
diff --git a/Tests/RunCMake/cmake_host_system_information/VsMSBuild.cmake b/Tests/RunCMake/cmake_host_system_information/VsMSBuild.cmake
new file mode 100644
index 0000000..30e616e
--- /dev/null
+++ b/Tests/RunCMake/cmake_host_system_information/VsMSBuild.cmake
@@ -0,0 +1,4 @@
+cmake_host_system_information(RESULT msbuild QUERY VS_MSBUILD_COMMAND)
+if(NOT EXISTS "${msbuild}")
+ message(FATAL_ERROR "VS_MSBUILD_COMMAND returned path that does not exist:\n ${msbuild}")
+endif()
diff --git a/Tests/RunCMake/cmake_host_system_information/VsMSBuildMissing-result.txt b/Tests/RunCMake/cmake_host_system_information/VsMSBuildMissing-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/cmake_host_system_information/VsMSBuildMissing-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_host_system_information/VsMSBuildMissing-stderr.txt b/Tests/RunCMake/cmake_host_system_information/VsMSBuildMissing-stderr.txt
new file mode 100644
index 0000000..3a7dfef
--- /dev/null
+++ b/Tests/RunCMake/cmake_host_system_information/VsMSBuildMissing-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at VsMSBuildMissing.cmake:[0-9]+ \(cmake_host_system_information\):
+ cmake_host_system_information does not recognize <key> VS_MSBUILD_COMMAND
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/cmake_host_system_information/VsMSBuildMissing.cmake b/Tests/RunCMake/cmake_host_system_information/VsMSBuildMissing.cmake
new file mode 100644
index 0000000..23c0364
--- /dev/null
+++ b/Tests/RunCMake/cmake_host_system_information/VsMSBuildMissing.cmake
@@ -0,0 +1 @@
+cmake_host_system_information(RESULT msbuild QUERY VS_MSBUILD_COMMAND)