Hi,
I work with the latest nightly and Windows 7.
I wanted to know how to set the working dir for the post build steps of a project. Currently it is always the same directory as the .cbp file. In the properties you can set the execution working dir, but this seems to have no effect on the pre/post-build steps. I need this for automated testing, the tests have data they need to process and will only find it if the executable is called from the correct working dir.
Changing the paths in the software is not an option, as this would imply not only changing the paths in the testing environment (which would not be a big problem) but also in the original code (which would definitely be a problem).
A simple cmd /c cd .. won't do the trick either.
Any help is appreciated.
Thanks,
Koonschi
Huh, found a solution:
Enchaining multiple commands with & seems to work.
cmd /c cd .. & Server.Test\bin\Debug\ServerTest.exe
previous version
cmd /c cd ..
cmd /c Server.Test\bin\Debug\ServerTest.exe
didn't work as the console terminated after changing the directory, thus changing nothing.
I'd still be interested if it is possible to change the working directory for the pre/post build steps from codeblocks.
Cheers,
Koonschi
Have you tried inserting the macros '$outputdir' etc... to your post build commands?
No, but that could be an approach. Is there a list of all available macros?
http://wiki.codeblocks.org/index.php?title=Variable_expansion (http://wiki.codeblocks.org/index.php?title=Variable_expansion)