How to set the output path for a vC ++ project different from its dependencies (nuget)?

Premise
I have a Visual Studio 2015 solution containing various VC ++ projects.
Some of them (EXE and some DLLs) have the default $ OutDir set "$ (SolutionDir) $ (Configuration) \" (i.e., "C: \ MySolution \ Debug \").
For some other projects (DLLs), I need to change the output path to the $ OutDir default subdirectory (i.e., "C: \ MySolution \ Debug \ Pieces \".

Example directory tree:

  C: \ MySolution \ Debug \  
     Myprogram.exe  
     Dependency.dll  
     . \ Pieces \  
       Mypiece1.dll  
       Mypiece2.dll  

Limitations
The "Pieces" DLL depends on the third-party Dependency.dll (via the NuGet package), which I cannot change.

The usual solution
The usual way to do this is to change the $ OutDir project setting for piece projects, but it will also cause their dependencies to be displayed in the same sub-directory.
This is not required, and also creates problems when debugging and packaging the entire solution.

What have i tried so far
I tried: 1. keep $ OutDir the same for all projects
2. change the "pieces" of $ TargetName to "Pieces \ $ (ProjectName)"
This seems to work (both MyPiece * .dlland Dependency.dll is correctly placed, and debugging is in order), but, unfortunately, Visual Studio generates the following warning:

warning MSB8012: TargetName (Pieces \ MyPiece1.dll) does not match the value of the Linker OutputFile property (MyPiece1). This can lead to improper construction of your project. To fix this, make sure that the property values โ€‹โ€‹$ (OutDir), $ (TargetName) and $ (TargetExt) match the value specified in% (Link.OutputFile).

This warning is somewhat confusing because the% Link.OutputFile in the project settings looks correct:
$ (OutDir) $ (TargetName) $ (TargetExt) => C: \ MySolution \ Debug \ Pieces \ MyPiece1.dll

Question
What is the right approach to solving my problem?
How to get Visual Studio to output some of the generated files in a different way, but still having its Nuget dependencies in the "default" $ OutDir?

I have already searched the web and StackOverflow, but I cannot find a suitable answer.
Note: my problem is not related to updating the solution to VS2010 (as in the Microsoft Legal Notices about warning MSB8012 after updating the solution and https://stackoverflow.com/a/164609/ ).

+7
warnings visual-c ++ - 2015
source share

No one has answered this question yet.

See similar questions:

eleven
How to fix warning MSB8012 in a static library project in Visual C ++ 2010?

or similar:

23
warning MSB8012: make sure that the values โ€‹โ€‹of the $ (OutDir), $ (TargetName) and $ (TargetExt) properties match the value specified in% (Link.OutputFile)
thirteen
How can I catch exit from carp in Perl?
4
warning MSB8012 when changing output file settings
3
Can I compile different parts of my project with different warning levels using CMake?
one
C: \ Program Files (x86) \ Windows Kits \ 8.1 \ Include \ um \ dbghelp.h (1545): error C2220: the warning is treated as an error - the file 'object' is not created
0
How can I get the relative path?
0
How to create a different class than the one that is being called?
0
How to disable parallel assembly for a specific project?
0
Mismatch between project processor architecture and link processor architecture
0
Video to extract frames in C #

All Articles