diff options
author | Michael Stürmer <michael.stuermer@schaeffler.com> | 2016-11-30 17:20:31 +0100 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-11-30 11:45:11 -0500 |
commit | 163e8018098699b15f7aef9ded444aa72de49701 (patch) | |
tree | d45cf50786e3271c673c603d3996f88899603665 /Tests/RunCMake/VS10Project/VsDebuggerWorkingDir-check.cmake | |
parent | afe7d5f26d16a76d26ac361d7a41a5119d20dd11 (diff) | |
download | cmake-163e8018098699b15f7aef9ded444aa72de49701.tar.gz |
VS: Add target property VS_DEBUGGER_WORKING_DIRECTORY
Diffstat (limited to 'Tests/RunCMake/VS10Project/VsDebuggerWorkingDir-check.cmake')
-rw-r--r-- | Tests/RunCMake/VS10Project/VsDebuggerWorkingDir-check.cmake | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir-check.cmake b/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir-check.cmake new file mode 100644 index 0000000000..637c68c60b --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir-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(debuggerWorkDirSet FALSE) + +file(STRINGS "${vcProjectFile}" lines) +foreach(line IN LISTS lines) + if(line MATCHES "^ *<LocalDebuggerWorkingDirectory[^>]*>([^<>]+)</LocalDebuggerWorkingDirectory>$") + if("${CMAKE_MATCH_1}" STREQUAL "my-debugger-directory") + message(STATUS "foo.vcxproj has debugger working dir set") + set(debuggerWorkDirSet TRUE) + endif() + endif() +endforeach() + +if(NOT debuggerWorkDirSet) + set(RunCMake_TEST_FAILED "LocalDebuggerWorkingDirectory not found or not set correctly.") + return() +endif() |