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/ ).
warnings visual-c ++ - 2015
roalz
source share