I have existing project in Code::Blocks 17.12 and I would like to add command after build using script (Properties -> build scripts).
Are pre/post build steps in Code:Blocks doing same thing as AddCommandsBeforeBuild/AddCommandsAfterBuild scripting commands? How to use AddCommandsBeforeBuild and AddCommandsAfterBuild?
I tried to add post build commands to existing project using script:
// My script - why it does not work?
function SetBuildOptions(base)
{
base.AddCommandsBeforeBuild(_T("cmd /c mkdir bbb"));
base.AddCommandsAfterBuild(_T("cmd /c mkdir ccc"));
}
but it doesn't work. If I put the following command directly to the Build options -> Pre/post build steps it works fine:
Script in general also works fine, because if I put following example in script, the directory is created and compiler option is added:
// My script - example of working commands
function SetBuildOptions(base)
{
IO.Execute(_T("cmd /c mkdir aaa"));
base.AddCompilerOption(_T("-Os"));
}
In addiction AddCompilerOption and AddCommandsAfterBuild are both defined in same base:
http://wiki.codeblocks.org/index.php/Scripting_commands#CompileOptionsBaseI noticed that AddCommandsAfterBuild is used (for example) in AVR template like this:
// Template avr/wizard.script
function SetupProject(project)
{
project.AddCommandsAfterBuild(pb_lockhex);
}
but if I put that function to my script it doesn't work.
Is it even possible to use AddCommandsAfterBuild in normal (not template) script with existing project?