Page 1 of 1

Copying files to output directory

Posted: Sat Feb 06, 2016 3:12 am
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.

Re: Copying files to output directory

Posted: Sat Feb 06, 2016 6:25 am
by eranif
Project settings->Pre/Post build commands->Post build

Eran

Re: Copying files to output directory

Posted: Sat Feb 06, 2016 2:59 pm
by Rokner
So I have to write to commands to copy the files manually?

Re: Copying files to output directory

Posted: Sat Feb 06, 2016 7:51 pm
by eranif
Yes you do

Eran

Re: Copying files to output directory

Posted: Sun Feb 07, 2016 12:00 am
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.

Re: Copying files to output directory

Posted: Sun Feb 07, 2016 12:18 am
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

Re: Copying files to output directory

Posted: Sun Feb 07, 2016 12:22 am
by Rokner
Yeah this works too. I'll probably use it.