mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-23 07:28:51 -06:00
@@ -296,6 +296,7 @@ Properties on Targets
|
||||
/prop_tgt/VISIBILITY_INLINES_HIDDEN
|
||||
/prop_tgt/VS_CONFIGURATION_TYPE
|
||||
/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY
|
||||
/prop_tgt/VS_DEBUGGER_COMMAND
|
||||
/prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION
|
||||
/prop_tgt/VS_DOTNET_REFERENCE_refname
|
||||
/prop_tgt/VS_DOTNET_REFERENCEPROP_refname_TAG_tagname
|
||||
|
||||
9
Help/prop_tgt/VS_DEBUGGER_COMMAND.rst
Normal file
9
Help/prop_tgt/VS_DEBUGGER_COMMAND.rst
Normal file
@@ -0,0 +1,9 @@
|
||||
VS_DEBUGGER_COMMAND
|
||||
-------------------
|
||||
|
||||
Sets the local debugger command for Visual Studio C++ targets.
|
||||
This is defined in ``<LocalDebuggerCommand>`` in the Visual Studio
|
||||
project file.
|
||||
|
||||
This property only works for Visual Studio 2010 and above;
|
||||
it is ignored on other generators.
|
||||
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 debugging command line can be set using a new
|
||||
:prop_tgt:`VS_DEBUGGER_COMMAND` target property.
|
||||
@@ -2180,6 +2180,13 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
|
||||
<< "</LocalDebuggerWorkingDirectory>\n";
|
||||
}
|
||||
|
||||
if (const char* debuggerCommand =
|
||||
this->GeneratorTarget->GetProperty("VS_DEBUGGER_COMMAND")) {
|
||||
this->WritePlatformConfigTag("LocalDebuggerCommand", config, 2);
|
||||
*this->BuildFileStream << cmVS10EscapeXML(debuggerCommand)
|
||||
<< "</LocalDebuggerCommand>\n";
|
||||
}
|
||||
|
||||
std::string name =
|
||||
cmSystemTools::GetFilenameWithoutLastExtension(targetNameFull);
|
||||
this->WritePlatformConfigTag("TargetName", config, 2);
|
||||
|
||||
@@ -3,6 +3,7 @@ run_cmake(VsConfigurationType)
|
||||
run_cmake(VsTargetsFileReferences)
|
||||
run_cmake(VsCustomProps)
|
||||
run_cmake(VsDebuggerWorkingDir)
|
||||
run_cmake(VsDebuggerCommand)
|
||||
run_cmake(VsCSharpCustomTags)
|
||||
run_cmake(VsCSharpReferenceProps)
|
||||
run_cmake(VsCSharpWithoutSources)
|
||||
|
||||
22
Tests/RunCMake/VS10Project/VsDebuggerCommand-check.cmake
Normal file
22
Tests/RunCMake/VS10Project/VsDebuggerCommand-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(debuggerCommandSet FALSE)
|
||||
|
||||
file(STRINGS "${vcProjectFile}" lines)
|
||||
foreach(line IN LISTS lines)
|
||||
if(line MATCHES "^ *<LocalDebuggerCommand[^>]*>([^<>]+)</LocalDebuggerCommand>$")
|
||||
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()
|
||||
5
Tests/RunCMake/VS10Project/VsDebuggerCommand.cmake
Normal file
5
Tests/RunCMake/VS10Project/VsDebuggerCommand.cmake
Normal file
@@ -0,0 +1,5 @@
|
||||
enable_language(CXX)
|
||||
add_library(foo foo.cpp)
|
||||
|
||||
set_target_properties(foo PROPERTIES
|
||||
VS_DEBUGGER_COMMAND "my-debugger-command")
|
||||
Reference in New Issue
Block a user