How to set Visual Studio Output Directory?

1k views Asked by At

I have a c++ project in Visual Studio 2019. The project has set the Output Directory to a specific path and since it is part of the .vcxproj file it is commited in git. I would like to change the path to something else since the path doesn't exist on my computer but I don't want to make changes to the .vcxproj file. Is there a way to override the value from the .vcxproj file?

2

There are 2 answers

0
IMil On

If the other team members are OK with this, you may consider creating a new build configuration specially for you.

So that there will be build configurations "Debug", "Release", "DenJasonLocal". The others will just have to ignore it, or (if your configuration uses relative paths) might even find it useful.

0
Den-Jason On

Surely the output of the project would be underneath the solution tree?

Irrespective of that, a couple of ideas for you:

  1. Copy the whole directory tree (except the .git directory) to your own work directory, perform your edits there, and merge the changes back (except for the output directory entry in the .vcxproj file) using a diff product such as Beyond Compare.

  2. Side-step the VS project by using CMake to perform the build. See an example I wrote here: Linking Crypto++ fails when building a C++ project using CMake

  3. If the existing output directory is OK, but you want it to be copied to somewhere else, add a post-build step which runs a batch file to perform the copy.