summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/VS10Project/VsDebuggerCommand-check.cmake
diff options
context:
space:
mode:
authorHannes Mezger <hannes.mezger@ascolab.com>2018-03-12 15:19:08 (GMT)
committerBrad King <brad.king@kitware.com>2018-03-14 17:27:15 (GMT)
commit5a7113d8fb2a6f1290b4533ff46e88a55fc2c656 (patch)
tree2180d382b160215a73e7a5d46591bbf0c62f2294 /Tests/RunCMake/VS10Project/VsDebuggerCommand-check.cmake
parentb340cacde869102b2b548b2e7ebc7341334f1d58 (diff)
downloadCMake-5a7113d8fb2a6f1290b4533ff46e88a55fc2c656.zip
CMake-5a7113d8fb2a6f1290b4533ff46e88a55fc2c656.tar.gz
CMake-5a7113d8fb2a6f1290b4533ff46e88a55fc2c656.tar.bz2
VS: Add target property VS_DEBUGGER_COMMAND
Fixes: #17819
Diffstat (limited to 'Tests/RunCMake/VS10Project/VsDebuggerCommand-check.cmake')
-rw-r--r--Tests/RunCMake/VS10Project/VsDebuggerCommand-check.cmake22
1 files changed, 22 insertions, 0 deletions
diff --git a/Tests/RunCMake/VS10Project/VsDebuggerCommand-check.cmake b/Tests/RunCMake/VS10Project/VsDebuggerCommand-check.cmake
new file mode 100644
index 0000000..0ded780
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsDebuggerCommand-check.cmake
@@ -0,0 +1,22 @@
+set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj")
+if(NOT EXISTS "${vcProjectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.")
+ return()
+endif()
+
+set(debuggerCommandSet FALSE)
+
+file(STRINGS "${vcProjectFile}" lines)
+foreach(line IN LISTS lines)
+ if(line MATCHES "^ *<LocalDebuggerCommand[^>]*>([^<>]+)</LocalDebuggerCommand>$")
+ if("${CMAKE_MATCH_1}" STREQUAL "my-debugger-command")
+ message(STATUS "foo.vcxproj has debugger command set")
+ set(debuggerCommandSet TRUE)
+ endif()
+ endif()
+endforeach()
+
+if(NOT debuggerCommandSet)
+ set(RunCMake_TEST_FAILED "LocalDebuggerCommand not found or not set correctly.")
+ return()
+endif()