Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Copy files from source to build directory as part of compilation.
Copy files from source to build directory as part of compilation. [message #726698] Mon, 19 September 2011 05:49 Go to next message
Jacob  is currently offline Jacob
Messages: 4
Registered: August 2011
Junior Member
I have a project where the C compiler generates XML files. I would like these files to be copied to the build directory (similar to how Eclipse/CDT handles unknown files and .o files).
Is there any parameter to control this?
Re: Copy files from source to build directory as part of compilation. [message #726719 is a reply to message #726698] Mon, 19 September 2011 06:50 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1949
Registered: July 2009
Senior Member
You can apply a Post Build step (Project Properties->C/C++ Build->Settings)

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Copy files from source to build directory as part of compilation. [message #726729 is a reply to message #726719] Mon, 19 September 2011 07:24 Go to previous messageGo to next message
Jacob  is currently offline Jacob
Messages: 4
Registered: August 2011
Junior Member
OK, Are there any environment variables I can use in the "Post-build step" field?
Like "cp $SOURCE_DIRECTORY/*.xml $BUILD_DIRECTORY/"?
Re: Copy files from source to build directory as part of compilation. [message #726937 is a reply to message #726729] Mon, 19 September 2011 22:07 Go to previous messageGo to next message
Tim Westbrook is currently offline Tim Westbrook
Messages: 8
Registered: March 2011
Junior Member
My version of Eclipse CDT (Helios) doesn't have the Post Build Step but I use builders for stuff like this.
Go to Project Preferences->Builders->New->Program and call any program every time the build is called, click on variables to see what variables are available to substitute in your copy command, additionally the "env_var" is a special variable that lets you access environment variables.

build_files is also a useful var as it is only passed files/dirs that have changed.

Cheers
-Tim
Re: Copy files from source to build directory as part of compilation. [message #1052867 is a reply to message #726937] Tue, 30 April 2013 15:40 Go to previous message
Scott Bell is currently offline Scott Bell
Messages: 5
Registered: July 2009
Junior Member
This doesn't work. ${build_files} is never set to anything.

Any idea why this would be?
Previous Topic:context sensitive editor for new language.
Next Topic:build_files Environment Variable
Goto Forum:
  


Current Time: Thu Aug 21 10:08:38 EDT 2014

Powered by FUDForum. Page generated in 0.03038 seconds