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 09:49 Go to next message
Jacob  is currently offline Jacob Friend
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 10:50 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
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 11:24 Go to previous messageGo to next message
Jacob  is currently offline Jacob Friend
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] Tue, 20 September 2011 02:07 Go to previous messageGo to next message
Tim Westbrook is currently offline Tim WestbrookFriend
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 19:40 Go to previous messageGo to next message
Scott Bell is currently offline Scott BellFriend
Messages: 5
Registered: July 2009
Junior Member
This doesn't work. ${build_files} is never set to anything.

Any idea why this would be?
Re: Copy files from source to build directory as part of compilation. [message #1750586 is a reply to message #1052867] Fri, 23 December 2016 06:02 Go to previous messageGo to next message
MIh ffo is currently offline MIh ffoFriend
Messages: 1
Registered: December 2016
Junior Member
I have the same.
In Eclipse Neon on Project Properties in C/C++ Build settings at Build Steps tab i've wrote Post-build steps Command like this:
cp -u ${PWD}/*.hex ~/install/

that's means Copy with update option from path in environment variable PWD to ~/install/ folder.
Variables in your eclipse you can see in C/C++ Build\Environment settings.
Re: Copy files from source to build directory as part of compilation. [message #1750679 is a reply to message #1750586] Sun, 25 December 2016 00:13 Go to previous message
David Vavra is currently offline David VavraFriend
Messages: 629
Registered: October 2012
Senior Member
Wrong message reply.

[Updated on: Sun, 25 December 2016 02:55]

Report message to a moderator

Previous Topic:Storing language.settings.xml in a VCS
Next Topic:Boost 1.62.0 with Eclipse neon CDT on Windows 7
Goto Forum:
  


Current Time: Mon Dec 18 07:13:16 GMT 2017

Powered by FUDForum. Page generated in 0.02396 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software