diff options
author | Michael Stürmer <michael.stuermer@schaeffler.com> | 2016-11-30 16:20:31 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-11-30 16:45:11 (GMT) |
commit | 163e8018098699b15f7aef9ded444aa72de49701 (patch) | |
tree | d45cf50786e3271c673c603d3996f88899603665 /Tests/RunCMake/VS10Project/VsDebuggerWorkingDir-check.cmake | |
parent | afe7d5f26d16a76d26ac361d7a41a5119d20dd11 (diff) | |
download | CMake-163e8018098699b15f7aef9ded444aa72de49701.zip CMake-163e8018098699b15f7aef9ded444aa72de49701.tar.gz CMake-163e8018098699b15f7aef9ded444aa72de49701.tar.bz2 |
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 0000000..637c68c --- /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() |