Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Xaviou on August 29, 2006, 05:53:51 pm

Title: New Project Wizard script
Post by: Xaviou on August 29, 2006, 05:53:51 pm
Hello,

I'm trying to create my own wizard. I don't want it to show the standard "Compiler / Targets" page, but I want to create my own page for this.

My question is : Hown can I add customized build targets to the new project ? I found a "AddBuildTarget" function, but I don't know how to use it.
I didn't found any help on this, neither in this forum, nor in the wiki (http://wiki.codeblocks.org/index.php?title=Wizard_Scripting_Commands).

Can someone help me, please ?
Title: Re: New Project Wizard script
Post by: Xaviou on August 29, 2006, 06:51:40 pm
Hi !

After a couple of tests, I've founded something.

The AddBuildTarget can simply be used like this :

Code
local target=project.AddBuildTarget(_T("target1"));

But another problem persists : how to remove the "default" target automatically created by the wizard ?

Thanks for your replies ...
Title: Re: New Project Wizard script
Post by: Trikko on August 31, 2006, 10:50:52 pm
Try with:

project.RemoveBuildTarget(_T("default"));

it works for me.

But i have another problem. I've created a lot of target but all file inside of them are not set for compiling (see checklistbox on project properties/ targets)
Title: Re: New Project Wizard script
Post by: Xaviou on September 01, 2006, 12:44:59 am
Hello.

Thanks for the "project.RemoveBuildTarget" function, I'll try it.

I think I found why all files are unselected in the new targets we create (yes, I have the same problem).

If you have a look at the ScriptedWizard's source code, you'll see that the "SetupProject" function is called after all files are added to all build targets. It is also why the "default" target is created (I think).

If you want files to be selected with all targets, you must create your targets before the "GetFiles" function is called, for example, when leaving the last wizard page. But the problem is : How to get the "project" variable to do this ?