Copy files after compiling

CodeLite installation/troubleshooting forum
slimmeke

Copy files after compiling

Post by slimmeke »

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: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Copy files after compiling

Post by eranif »

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

Re: Copy files after compiling

Post by slimmeke »

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: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Copy files after compiling

Post by eranif »

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

Re: Copy files after compiling

Post by slimmeke »

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: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Copy files after compiling

Post by eranif »

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

Re: Copy files after compiling

Post by slimmeke »

Tnx I have found it and it works.

Now I have

Code: Select all

xcopy /I Libraries\bin\Debug_X86 Debug
Post Reply