News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

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

Started by shajunxing, March 06, 2007, 07:26:14 AM

Previous topic - Next topic

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

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


Change to

    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


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. :)
Be a part of the solution, not a part of the problem.