Author Topic: New target wizard: makes sense?  (Read 3831 times)

Offline Commodore64

  • Multiple posting newcomer
  • *
  • Posts: 35
New target wizard: makes sense?
« on: March 21, 2007, 08:56:23 am »
Hi,
I wanted to suggest, if it makes sense, to introduce "new target" wizards.
Here are some scenarios where they may be useful:

Imagine you are working on a wxWidgets project, configured through the wxWidgets wizard, and using MinGW (for example because you want to use the debugger). Later on you want to add a new target to compile with MSVC (for example because it compiles fast and produces smaller executables). Currently, if I am not wrong, you have to configure the new target by hand, or create a completely new project with the wxWidgets wizard (please correct me if I am missing something). With a "new wxWidgets target" wizard you would be able to auto-configure a new MSVC target in the existing project.

Another scenario: you port the same wxWidgets project to Linux. You want to add Linux targets using a wxWidgets target wizard (this would facilitate the migration towards cross-platform project files).

Notice that the current project wizards could be rewritten so that they (1) create a new project, and (2) call the corresponding new targets wizard.

What do you think about it?
Regards,
Luca

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: New target wizard: makes sense?
« Reply #1 on: March 21, 2007, 09:29:32 am »
Currently, if I am not wrong, you have to configure the new target by hand, or create a completely new project with the wxWidgets wizard (please correct me if I am missing something). With a "new wxWidgets target" wizard you would be able to auto-configure a new MSVC target in the existing project.

I'm afraid this is a bit difficult to implement with the current wizard.

Alternatively you can use another feature of C::B to overcome this. Use the workspace feature. Follow the following steps.
  • Create an Empty wxWidgets Project with MSVC compiler selected to different folder.
  • Now close the empty project and copy the C::B Project file (*.cbp) to your old project's folder.
  • Open your old project first.
  • Then open your new empty project without closing the old project. Now both the projects will be shown open in workspace.
  • Now add your source files to empty project. Save the empty project to reflect changes.
  • Now save the workspace using File>Save workspace menu

Now if you open the workspace, it will show you both the projects and you may use anyone at a time.

Though this is not an elegant solution, but it should work. :)

Regards,

Biplab
Be a part of the solution, not a part of the problem.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: New target wizard: makes sense?
« Reply #2 on: March 21, 2007, 09:34:10 am »
Quote
Notice that the current project wizards could be rewritten so that they (1) create a new project, and (2) call the corresponding new targets wizard.

It is very possible that the same wizard can be used for new projects as well as new targets. The scripted wizards system has been designed to allow this.

For project wizards, the function "SetupProject(project)" is called in the script to setup the project.
For target wizards, the function "SetupTarget(target, debug_flag)" is called instead to setup the target.

Making a wizard usable both as a project and target wizard is as easy as including both of the above functions in the script. Of course this doesn't mean that the project/target setup must be duplicated. Just put the target setup code in SetupTarget and then call SetupTarget from inside SetupProject.
I don't know if I made it sound complicated but it really is not :).

EDIT: Check the console wizard's script. It does exactly what I described above.
« Last Edit: March 21, 2007, 09:36:11 am by mandrav »
Be patient!
This bug will be fixed soon...

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: New target wizard: makes sense?
« Reply #3 on: March 21, 2007, 09:40:22 am »
EDIT: Check the console wizard's script. It does exactly what I described above.

Hmm... I've got some interesting clue to improve the wizard. Thanks for pointing it. :D
Be a part of the solution, not a part of the problem.

Offline Commodore64

  • Multiple posting newcomer
  • *
  • Posts: 35
Re: New target wizard: makes sense?
« Reply #4 on: March 21, 2007, 02:48:03 pm »
Thank you very much for your support!  :D

Actually I didn't notice that there is already the option "Build target" in the new menu... I have to be blind  :oops: sorry...

Anyway, thanks again!
Luca