summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/VS10Project/VsDebuggerCommand-check.cmake
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:13:24 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:13:24 +0900
commite42c4abb646a39cdd5d1ccb22a9619990ce2a898 (patch)
tree5c4a99e76409f26c9525137e845d0bac7efa8c7b /Tests/RunCMake/VS10Project/VsDebuggerCommand-check.cmake
parent07408dd83a3637a29a56a7d5fbe49f63cbb41e8f (diff)
downloadcmake-e42c4abb646a39cdd5d1ccb22a9619990ce2a898.tar.gz
cmake-e42c4abb646a39cdd5d1ccb22a9619990ce2a898.tar.bz2
cmake-e42c4abb646a39cdd5d1ccb22a9619990ce2a898.zip
Imported Upstream version 3.12.0upstream/3.12.0
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 000000000..0ded7806d
--- /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()