Page 1 of 1

Copy files after compiling

Posted: Sun Jul 27, 2014 3:58 pm
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?

Re: Copy files after compiling

Posted: Sun Jul 27, 2014 4:42 pm
by eranif
cp is not a standard windows command...
You should use copy, xcopy etc

Eran

Re: Copy files after compiling

Posted: Sun Jul 27, 2014 5:01 pm
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?

Re: Copy files after compiling

Posted: Sun Jul 27, 2014 5:05 pm
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

Re: Copy files after compiling

Posted: Sun Jul 27, 2014 5:17 pm
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

Re: Copy files after compiling

Posted: Sun Jul 27, 2014 5:34 pm
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

Re: Copy files after compiling

Posted: Sun Jul 27, 2014 6:08 pm
by slimmeke
Tnx I have found it and it works.

Now I have

Code: Select all

xcopy /I Libraries\bin\Debug_X86 Debug