Copy files after compiling

CodeLite installation/troubleshooting forum
slimmeke
CodeLite Curious
Posts: 8
Joined: Wed Sep 18, 2013 7:20 pm
Genuine User: Yes
IDE Question: C++
Contact:

Copy files after compiling

Post by slimmeke » Sun Jul 27, 2014 3:58 pm

I want to copy different files (dll and data images, ...).
But when I insert the code to my post build settings of my project I got an error.
The code I use is:
cp /Libraries/bin/Debug_X86/* /Debug/*

The error that I have is:
process_begin: CreateProcess(NULL, cp /Libraries/bin/Debug_X86/* /Debug/*, ...) failed.

My folder structure is:

Project
- Game
- GameData
- GameEngine
- Libraries
__ - bin
____ -Debug_X86

Any idee how I can fix this?

User avatar
eranif
CodeLite Plugin
Posts: 5934
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Copy files after compiling

Post by eranif » Sun Jul 27, 2014 4:42 pm

cp is not a standard windows command...
You should use copy, xcopy etc

Eran
Make sure you have read the HOW TO POST thread

slimmeke
CodeLite Curious
Posts: 8
Joined: Wed Sep 18, 2013 7:20 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Copy files after compiling

Post by slimmeke » Sun Jul 27, 2014 5:01 pm

Ok I have changed the script to:
xcopy /I /Libraries/bin/Debug_X86/ /Debug/

Does not work yet. But is there a variable that points to the project folder. For example {Project} that does link to C:\Project \Folder?
Or does the script always run in the project main folder?

User avatar
eranif
CodeLite Plugin
Posts: 5934
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Copy files after compiling

Post by eranif » Sun Jul 27, 2014 5:05 pm

slimmeke wrote:Does not work yet
This is very vague. Please explain what is not working
slimmeke wrote:ut is there a variable that points to the project folder
By default, the working directory is set to the project folder

PS. Please read the HOW TO POST thread (link in my signature)

Eran
Make sure you have read the HOW TO POST thread

slimmeke
CodeLite Curious
Posts: 8
Joined: Wed Sep 18, 2013 7:20 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Copy files after compiling

Post by slimmeke » Sun Jul 27, 2014 5:17 pm

I have changed my script to:
xcopy /I Libraries\bin\Debug_X86\ Debug\.

When I run this in the cmd everything works fine.
When I do this in the post build I get some error:

mingw32-make.exe[1]: Entering directory 'D:/Downloads/SimuVille'
Executing Post Build commands ...
File not found - Debug_X86 Debug@echo
mingw32-make.exe[1]: *** [PostBuild] Error 4
mingw32-make.exe: *** [All] Error 2
xcopy /I Libraries\bin\Debug_X86\ Debug\
@echo Done
0 File(s) copied
SimuVille.mk:88: recipe for target 'PostBuild' failed

User avatar
eranif
CodeLite Plugin
Posts: 5934
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Copy files after compiling

Post by eranif » Sun Jul 27, 2014 5:34 pm

The problem is that your command ends with a backspace "\", which means: "the command continues on the next line"
So the built-in

Code: Select all

@echo Done
is treated as part of your command...

Change your post build command to (note the missing backspace at the end of the command)

Code: Select all

xcopy /I Libraries\bin\Debug_X86\ Debug
Eran
Make sure you have read the HOW TO POST thread

slimmeke
CodeLite Curious
Posts: 8
Joined: Wed Sep 18, 2013 7:20 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Copy files after compiling

Post by slimmeke » Sun Jul 27, 2014 6:08 pm

Tnx I have found it and it works.

Now I have

Code: Select all

xcopy /I Libraries\bin\Debug_X86 Debug

Post Reply