From e42c4abb646a39cdd5d1ccb22a9619990ce2a898 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Fri, 8 Oct 2021 09:13:24 +0900 Subject: Imported Upstream version 3.12.0 --- .../VS10Project/VsDebuggerCommand-check.cmake | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Tests/RunCMake/VS10Project/VsDebuggerCommand-check.cmake (limited to 'Tests/RunCMake/VS10Project/VsDebuggerCommand-check.cmake') 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 "^ *]*>([^<>]+)$") + 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() -- cgit v1.2.3