1. 4FipS.com
  2. Photos
  3. Videos
  4. Code
  5. Forums
  6. pfQuizzz
  7. About

4FipS.com Forums

Forums dedicated to the projects hosted at 4FipS.com

Skip to content

How to copy files to the MSVC 2010 output directory

> About coding, hacking, photography, and such...

How to copy files to the MSVC 2010 output directory

Postby FipS on Sun Sep 26, 2010 6:43 pm

It's a typical task that one needs to automatically copy a 3rd party file (e.g. a DLL library) to the project's output directory as a post-build step. Here's how it can be achieved in Microsoft Visual Studio 2010 (MSBuild). Let's assume we have a file structure like this:
Code: Select all
.../External/glew_1_5_5/lib/glew32.dll (source)
.../Game/Game.vcxproj (project file)
.../Game/{Debug or Release}/glew32.dll (destination)

It's quite simple, we just need to edit 'Game.vcxproj' and add the following lines to the end:
Code: Select all
<Project>
 ...
 <!-- BEGIN -->
 <Target Name="AfterBuild" > 
  <Copy SourceFiles="..\..\External\glew_1_5_5\lib\glew32.dll" DestinationFolder="$(OutDir)"></Copy> 
 </Target>
 <!-- END -->
</Project>
User avatar
FipS
Site Admin
 
Posts: 144
Joined: Wed Nov 12, 2008 9:49 pm
Location: Prague

How to copy files to the MSVC 2010 output directory

Sponsor

Sponsor
 

Return to 4FipS.com General Discussion & Blog

Who is online

Users browsing this forum: No registered users and 1 guest

cron