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 | |
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')
-rw-r--r-- | Tests/RunCMake/VS10Project/RunCMakeTest.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/VS10Project/VsDebuggerWorkingDir-check.cmake | 22 | ||||
-rw-r--r-- | Tests/RunCMake/VS10Project/VsDebuggerWorkingDir.cmake | 5 |
3 files changed, 28 insertions, 0 deletions
diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake index d913af7..bc1ec97 100644 --- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake +++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake @@ -2,3 +2,4 @@ include(RunCMake) run_cmake(VsConfigurationType) run_cmake(VsTargetsFileReferences) run_cmake(VsCustomProps) +run_cmake(VsDebuggerWorkingDir) 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() diff --git a/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir.cmake b/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir.cmake new file mode 100644 index 0000000..a277c65 --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir.cmake @@ -0,0 +1,5 @@ +enable_language(CXX) +add_library(foo foo.cpp) + +set_target_properties(foo PROPERTIES + VS_DEBUGGER_WORKING_DIRECTORY "my-debugger-directory") |