Skip to content

Instantly share code, notes, and snippets.

@UnaNancyOwen
Last active June 12, 2016 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UnaNancyOwen/665b3d7993785749b1033217d73540fa to your computer and use it in GitHub Desktop.
Save UnaNancyOwen/665b3d7993785749b1033217d73540fa to your computer and use it in GitHub Desktop.
Set Local Debugger Settings (Command Arguments and Environment Variables) using CMake
cmake_minimum_required( VERSION 2.8 )
# Create Solution(*.sln) and Project(*.vcxproj)
project( solution )
add_executable( project main.cpp )
# Set Local Debugger Settings (Command Arguments and Environment Variables)
set( COMMAND_ARGUMENTS "<commands>" )
set( ENVIRONMENT_VARIABLES "<variables>" )
configure_file( template.vcxproj.user.in ${CMAKE_BINARY_DIR}/project.vcxproj.user @ONLY )
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Local Debugger Settings (Command Arguments and Environment Variables) for All Configures -->
<PropertyGroup>
<LocalDebuggerCommandArguments>@COMMAND_ARGUMENTS@</LocalDebuggerCommandArguments>
<LocalDebuggerEnvironment>Path=@ENVIRONMENT_VARIABLES@;%Path%</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment