Visual Studio: copy dependent DLLs to target folder

I realize that this question has been asked before - but none of the answers apply to my specific case:

  • I have a solution containing a native C++ EXE project, which in turn depends on 40+ native C++ DLL projects (in the same solution).

  • The EXE project has the usual Debug, Release (and Profile) configuration, but since them same source code base is used to build three different applications (say A1, A2 and A3). In addition, it targets x32 and x64, so that's a total of 3 x 3 x 2 = 18 project configurations.

  • The DLL projects are shared by all three target applications, so there are only 3 (Debug, Release, Profile) times 2 (x32, x64) = 6 configurations.

  • Since the EXE project depends on the DLLs, it needs to copy the relevant output of the DLL projects to its target folder (or a subfolder thereof) whenever they are modified.

How would you handle updating of the DLLs?

  • A post-build action in each DLL project doesn't work (well), as it would have to copy the DLL to the relevant output folder of A1, A2 and A3. Any change in an output folder results in having to modify the post-build action in each of the 50 DLL projects.

  • I currently added the DLLs themselves as project items to the EXE project, and configured a custom build tool to copy it to the output folder. But that requires me to add each DLL 6 times, so I end up with 6 x 50 = 300 DLLs!

What I really need is something like a Copy Local option, which unfortunately only works assemblies. Do solution do you suggest to simplify this build setup?

10
задан Daniel Gehriger 10 February 2011 в 10:36
поделиться