Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Bug Fix - Console application output dir doesn't function correctly

(1/1)

shajunxing:
The default console application wizard uses "obj\Debug" and "obj\Release" as output dir for executables. But it doesn't work. Executables always generated in the project's root folder. So i tried to do find out the reason  and did some change in "share\CodeBlocks\templates\wizard\console\wizard.script".

Origin

--- Code: ---    target.SetTargetType(ttConsoleOnly);
    if (target.GetWorkingDir().Matches(_T("")))
        target.SetOutputFilename(target.SuggestOutputFilename());
    else
        target.SetOutputFilename(target.GetWorkingDir() + wxFILE_SEP_PATH + target.SuggestOutputFilename());

--- End code ---

Change to

--- Code: ---    target.SetTargetType(ttConsoleOnly);
//    if (target.GetWorkingDir().Matches(_T("")))
//        target.SetOutputFilename(target.SuggestOutputFilename());
//    else
//        target.SetOutputFilename(target.GetWorkingDir() + wxFILE_SEP_PATH + target.SuggestOutputFilename());
// Changed by shajunxing 07.03.05
if (is_debug)
{
        target.SetOutputFilename(Wizard.GetDebugOutputDir() + Wizard.GetProjectName() + DOT_EXT_EXECUTABLE);
}
else
{
        target.SetOutputFilename(Wizard.GetReleaseOutputDir() + Wizard.GetProjectName() + DOT_EXT_EXECUTABLE);
}
// end of Changed

--- End code ---

Now it works well. The executables and objects are also in the same folder("Debug" or "Release") which looks more comfortable.
 :lol:

Biplab:
Will apply it. Thanks for the fix. :)


Edit 1: Fix applied in modified form in revision 3683. Thanks for the fix. :)

Navigation

[0] Message Index

Go to full version