Copying files to output directory

General questions regarding the usage of CodeLite
Rokner
CodeLite Curious
Posts: 4
Joined: Sat Feb 06, 2016 3:10 am
Genuine User: Yes
IDE Question: c++
Contact:

Copying files to output directory

Post by Rokner »

Is there any way to copy some files to output automatically on build? Like if I have some images in my project to copy them to Debug/ folder.
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Copying files to output directory

Post by eranif »

Project settings->Pre/Post build commands->Post build

Eran
Make sure you have read the HOW TO POST thread
Rokner
CodeLite Curious
Posts: 4
Joined: Sat Feb 06, 2016 3:10 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Copying files to output directory

Post by Rokner »

So I have to write to commands to copy the files manually?
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Copying files to output directory

Post by eranif »

Yes you do

Eran
Make sure you have read the HOW TO POST thread
Rokner
CodeLite Curious
Posts: 4
Joined: Sat Feb 06, 2016 3:10 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Copying files to output directory

Post by Rokner »

Ok I wrote a script in ruby for copying the files but when I try to run it through the post build it crashes like this:

Code: Select all

F:/RubyScripts/copyToOutput.rb Content ./Debug OpenGIne.project
process_begin: CreateProcess(F:\RubyScripts\copyToOutput.rb, F:/RubyScripts/copyToOutput.rb Content ./Debug OpenGIne.project, ...) failed.
make (e=193): Error 193
mingw32-make.exe[1]: *** [PostBuild] Error 193
OpenGIne.mk:85: recipe for target 'PostBuild' failed
mingw32-make.exe[1]: Leaving directory 'F:/Google Drive/Programming/OpenGL/CodeLite/OpenGIne'
mingw32-make.exe: *** [All] Error 2
Makefile:4: recipe for target 'All' failed
====2 errors, 4 warnings, total time: 00:00:13 seconds====
And I run it like this :

Code: Select all

F:/RubyScripts/copyToOutput.rb Content $(IntermediateDirectory) $(ProjectName).project
Edit: The script is working when run normally

Edit 2: I managed to find a workaround by using a bat file which just simply executes the upper ^ command and executing the bat file instead of the .rb file. But if you have any other suggestions I'm open to hear them.
Last edited by Rokner on Sun Feb 07, 2016 12:19 am, edited 1 time in total.
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Copying files to output directory

Post by eranif »

Your command is pasted as is into the Makefile in the 'PostBuild' stage.
My guess is that Makefile does not know how to launch .rb files

Usually (never used Ruby myself), most interpreted languages can also be run like this:

Code: Select all

/path/to/ruby.exe <script-name>
So try using it like this
Make sure you have read the HOW TO POST thread
Rokner
CodeLite Curious
Posts: 4
Joined: Sat Feb 06, 2016 3:10 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Copying files to output directory

Post by Rokner »

Yeah this works too. I'll probably use it.
Post Reply