Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: shajunxing on March 06, 2007, 07:26:14 am

Title: Bug Fix - Console application output dir doesn't function correctly
Post by: shajunxing on March 06, 2007, 07:26:14 am
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());

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

Now it works well. The executables and objects are also in the same folder("Debug" or "Release") which looks more comfortable.
 :lol:
Title: Re: Bug Fix - Console application output dir doesn't function correctly
Post by: Biplab on March 06, 2007, 09:04:06 am
Will apply it. Thanks for the fix. :)



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