Code::Blocks Forums

User forums => Help => Topic started by: Okaya on June 05, 2010, 11:37:38 pm

Title: Adding custom project categories
Post by: Okaya on June 05, 2010, 11:37:38 pm
Hello everyone,

I've been trying to find a way to add custom project categories in the list shown under "File -> New -> Project..."  . The reason for this is that I am working simultaneously on different kinds of projects that make use of different sets of non-standard libraries.

Until now what I've been doing was to manually set the "Linker Settings" and "Include Directories" settings for each of my projects, whether through changing the settings in "Project -> Build Options" or by changing "Settings -> Compiler and Debugger". The first option changes the dependencies for only my current project, while the second one changes the defaults for the IDE.

What I would like is to define a few additional presets or categories which I could select from something like the "File -> New -> Project" dialog box. This would allow me to set my project's dependencies automatically through choosing the appropriate category or preset. I suppose that such a feature is probably available in Code::Blocks but I have been unable to find how it works, or find relevant documentation. Is it possible to do this? If so, how?

I am using Code::Blocks 8.02  .

Any help or feedback on approaching this issue would be most appreciated.

Okaya


Title: Re: Adding custom project categories
Post by: oBFusCATed on June 05, 2010, 11:47:29 pm
The project templates are just scripts,
so you can right click and then "Edit this script", save as new template and voilĂ 



Title: Re: Adding custom project categories
Post by: Jenna on June 05, 2010, 11:50:30 pm
Or you can create a project that fits your needs and save it as user-template ("File -> Save project as template"), and use it via "File -> New -> From template" or "Create a new project -> User templates".
Title: Re: Adding custom project categories
Post by: Okaya on June 06, 2010, 02:31:17 am
Thank you very much oBFusCATed and jens, this is very helpful feedback.

I understand that the scripting language used is Squirrel. I am currently not familiar with it but I'm sure it's a very powerful way to enhance project building. Hopefully I'll familiarize myself with it soon.

If I use a user template, is there a way to edit it after it's been created? I tried to but couldn't find a way to modify one after I made it. Is deleting and re-making the template the way to do this, or did I miss the editing capability of it?

Thank you in advance for any help and feedback.

Okaya
Title: Re: Adding custom project categories
Post by: CodeLemming on July 25, 2014, 02:49:39 am

If I use a user template, is there a way to edit it after it's been created? I tried to but couldn't find a way to modify one after I made it. Is deleting and re-making the template the way to do this, or did I miss the editing capability of it?


Now, I know this is a serious necro-post, but as I couldn't find the answer anywhere else on this forum I figured it would be best to post what I found/did here in case any one else has similar problems.

To edit one of your user templates you'll need to find it and open it in Code::Blocks. Not sure about other systems, but in Windows systems your user templates are hidden in
C:/Users/ **User_Name**/AppData/Roaming/CodeBlocks/UserTemplates (You may have to use the search bar in the windows explorer to find it as I did, just type in the name of the template you want to find in the search bar). Once it's opened in Code::Blocks, simply make changes and save.

Now, when you do this you may notice a new folder named user_project_templates has appeared somewhere containing your user templates. Far as I can tell, it's just sorta there. Not sure if making changes to the files in there will save any changes to your user templates (I'm just ignoring it).