Author Topic: Bug Fix - Console application output dir doesn't function correctly  (Read 3440 times)

Offline shajunxing

  • Multiple posting newcomer
  • *
  • Posts: 25
  • Sorry for my poor English ;)
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:

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Bug Fix - Console application output dir doesn't function correctly
« Reply #1 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. :)
« Last Edit: March 11, 2007, 06:58:25 am by Biplab »
Be a part of the solution, not a part of the problem.