mirror of
https://github.com/reactos/CMake.git
synced 2024-12-17 00:26:42 +00:00
Merge topic 'VS_DEBUGGER_WORKING_DIRECTORY'
163e8018
VS: Add target property VS_DEBUGGER_WORKING_DIRECTORY
This commit is contained in:
commit
75f2a1e459
@ -269,6 +269,7 @@ Properties on Targets
|
||||
/prop_tgt/VERSION
|
||||
/prop_tgt/VISIBILITY_INLINES_HIDDEN
|
||||
/prop_tgt/VS_CONFIGURATION_TYPE
|
||||
/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY
|
||||
/prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION
|
||||
/prop_tgt/VS_DOTNET_REFERENCES
|
||||
/prop_tgt/VS_DOTNET_TARGET_FRAMEWORK_VERSION
|
||||
|
6
Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst
Normal file
6
Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst
Normal file
@ -0,0 +1,6 @@
|
||||
VS_DEBUGGER_WORKING_DIRECTORY
|
||||
-----------------------------
|
||||
|
||||
Sets the local debugger working directory for Visual Studio C++ targets.
|
||||
This is defined in ``<LocalDebuggerWorkingDirectory>`` in the Visual Studio
|
||||
project file.
|
6
Help/release/dev/vs-debugger-config.rst
Normal file
6
Help/release/dev/vs-debugger-config.rst
Normal file
@ -0,0 +1,6 @@
|
||||
vs-debugger-configuration
|
||||
-------------------------
|
||||
|
||||
* For the :ref:`Visual Studio Generators` for VS 2010 and above
|
||||
the working directory for debugging can be set using a new
|
||||
:prop_tgt:`VS_DEBUGGER_WORKING_DIRECTORY` target property.
|
@ -1569,6 +1569,14 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
|
||||
*this->BuildFileStream << cmVS10EscapeXML(intermediateDir)
|
||||
<< "</IntDir>\n";
|
||||
|
||||
if (const char* workingDir = this->GeneratorTarget->GetProperty(
|
||||
"VS_DEBUGGER_WORKING_DIRECTORY")) {
|
||||
this->WritePlatformConfigTag("LocalDebuggerWorkingDirectory",
|
||||
config->c_str(), 3);
|
||||
*this->BuildFileStream << cmVS10EscapeXML(workingDir)
|
||||
<< "</LocalDebuggerWorkingDirectory>\n";
|
||||
}
|
||||
|
||||
std::string name =
|
||||
cmSystemTools::GetFilenameWithoutLastExtension(targetNameFull);
|
||||
this->WritePlatformConfigTag("TargetName", config->c_str(), 3);
|
||||
|
@ -2,3 +2,4 @@ include(RunCMake)
|
||||
run_cmake(VsConfigurationType)
|
||||
run_cmake(VsTargetsFileReferences)
|
||||
run_cmake(VsCustomProps)
|
||||
run_cmake(VsDebuggerWorkingDir)
|
||||
|
22
Tests/RunCMake/VS10Project/VsDebuggerWorkingDir-check.cmake
Normal file
22
Tests/RunCMake/VS10Project/VsDebuggerWorkingDir-check.cmake
Normal file
@ -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()
|
5
Tests/RunCMake/VS10Project/VsDebuggerWorkingDir.cmake
Normal file
5
Tests/RunCMake/VS10Project/VsDebuggerWorkingDir.cmake
Normal file
@ -0,0 +1,5 @@
|
||||
enable_language(CXX)
|
||||
add_library(foo foo.cpp)
|
||||
|
||||
set_target_properties(foo PROPERTIES
|
||||
VS_DEBUGGER_WORKING_DIRECTORY "my-debugger-directory")
|
Loading…
Reference in New Issue
Block a user