Codeblocks wizard for Linux

After hacking away at Roxlu’s windows/mac codeblocks wizard, I ended up making something slightly different, but for Linux users, more powerful.

This wizard uses arturo’s ofProject command-line tool to automatically generate new projects with addons, all from within the Codeblocks GUI.

The wizard also generates virtual folders (through ofProject) which Roxlu’s doesn’t (because the Codeblocks scripting API doesn’t yet support the creation of virtual folders).

It’s a “custom” wizard, as opposed to a “project” wizard (which is what Roxlu’s plug-in is).
The difference is that a project wizard uses the codeblocks scripting API to generate projects.
The custom wizard calls the python script directly to do this instead.

In order to get this to work I’ve had to modify the ofProject manager script a little, so you will need to copy the python file attached here to the location of your ofProjectManager directory. However if you are using OF version 0.061 or above this is no longer strictly necessary.

There’s a readme which explains how to get this working in the wizard archive.
Your Codeblocks wizard files should either be in /usr/share/codeblocks/templates/wizard or /usr/share/codeblocks/templates/wizard depending on your installation of Codeblocks.
This page will be useful as well, but my instructions are different:
http://code.google.com/p/ofcodeblocks/w-…-orksWizard

Make sure you have the ofProjectManager installed before you run the wizard, or obviously it won’t work.
You’ll also need to do something like:

  
sudo chmod -R 755 /usr/share/codeblocks/templates/wizard/openframeworks  

This makes sure there are no file permission problems generated in the .zip extraction process.

Big thanks to Arturo and Roxlu for their previous work which I was able to build upon!

[attachment=2:123e9ry1]Screenshot-3.png[/attachment:123e9ry1]

ofProjectManager.py.zip

ofcodeblocks_linux.zip

OK so I went and converted Roxlu’s addon plugin to linux:
http://forum.openframeworks.cc/t/code::blocks-plugin-for-openframeworks-in-progress/2389/12

It doesn’t use the python script so it doesn’t generate virtual folders but it works just as well, everything is added to the right places!

Thanx grimus. That’s a really helpful wizard!

Glad it’s useful…try it with the plugin, the combination makes creating new projects a ridiculously fast process!

This really look promising but I can’t build anything on gst linux prerelease!
Works fine on OFficial 006.
What should I modify?

  
-------------- Build: Debug in myTestProject ---------------  
  
Compiling: src/main.cpp  
In file included from ../../../libs/openFrameworks/ofMain.h:24,  
                 from /home/es/dev/of_fixed_preRelease_v006gst_linux/apps/my/myTestProject/src/main.cpp:1:  
../../../libs/openFrameworks/graphics/ofImage.h:8:23: error: FreeImage.h: Nessun file o directory  
In file included from ../../../libs/openFrameworks/ofMain.h:24,  
                 from /home/es/dev/of_fixed_preRelease_v006gst_linux/apps/my/myTestProject/src/main.cpp:1:  
../../../libs/openFrameworks/graphics/ofImage.h:97: error: ISO C++ forbids declaration of ‘FIBITMAP’ with no type  
../../../libs/openFrameworks/graphics/ofImage.h:97: error: expected ‘;’ before ‘*’ token  
../../../libs/openFrameworks/graphics/ofImage.h:98: error: ‘FIBITMAP’ has not been declared  
Process terminated with status 1 (0 minutes, 4 seconds)  
4 errors, 0 warnings  
   
  

Hi,
The error you are receiving looks like your setup can’t find FreeImage. Can you describe exactly what you are trying to do, and maybe post your project?

Hello, I didn’t posted any other detail because what I done was just to complete the wizard to make a new OF project, without specifying any additional library, using as application directory path:
…basedir/of_preRelease_v0.06_linux_cb_FAT/apps/my
or
…basedir/of_fixed_preRelease_v006gst_linux/apps/my
The first works the second not: It builds with of_preRelease_v0.06_linux_cb_FAT but not with of_fixed_preRelease_v006gst_linux
I think the path is correct because I see that libs are linked relatives (…/…/…/libs/…) and indeed the movie/opencv examples are building fine.

the codebase is indeed different

Edit: copying over FreeImage and rtAudio (from of_preRelease_v0.06_linux_cb_FAT) makes the gst based version to build!

thanks for any advice

Hello,

i tried the same on OpenSuse but the wizard does not create any project.

OpenSuse 11.1
OF 0.61
FreImage and rtAudio are present
(installed from of_preRelease_v0061_linux_FAT)

what should i send here to give more details on this problem ?

regs wally

wally, are you able to run the ofProject script independently? Have you included my additions to the OF project script as well?

If you have successfully setup Codeblocks and ofProject I think you shouldn’t have any problems, but I haven’t actually tested in on 0.061 so I will do this and let you know…

I just tried the wizard on 0.0061 and it works fine. Just remember to reset the ofProject path by running the install_project_manager.sh script. Also you need to use my ofProjectManager.py script that’s attached to this post. Arturo, any chance of including my changes? they are really quite minor… :wink:

has just added it to the downloadable package

Excellent, thanks!

Just a mileage report on installing this wizard on Ubuntu 10.10 with the codeblocks installed from the downloads on openframeworks.cc. it’s the 0.062 pre-release. Also I am running 32bit.

  1. I didn’t update the ofProjectManager.py script
  2. I extracted the wizard from the .zip file by double click and using the Gnome file Roller archive manager. (it’s the default one)
  3. I copied the wizard subdirectory by going into the directory where I extracted the .zip file and entering the command -
    sudo cp -r wizard/openframeworks /usr/share/codeblocks/templates/wizard
  4. I had to edit the config.script file not in codeblocks because you can’t save and codeblocks stopped responding, so first I went -
    locate config.script
    I discovered the file in /usr/share/codeblocks so here is the command to edit
    sudo vi /usr/share/codeblocks/templates/wizard/config.script
    you can substitute your favourite editor
  5. insert the command which I found in the readme.txt file in the zip file
    RegisterWizard(wizCustom, _T(“openframeworks”), _T(“OpenFrameworks”), _T(“2D/3D Graphics”));
  6. after some tests I discovered I still needed this command -
    sudo chmod 755 /usr/share/codeblocks/templates/wizard/openframeworks
  7. restart codeblocks and it works.

Maybe there is an easier way but this worked for me. The extraction may have muddled the permissions. Comments welcome. The icon png is still not showing up but I’ll scratch around some more an let you know if I figure it out.

Thanks to the makers of the wizard, and the porter/modifiers of the wizard.

Just pointing out that I fixed the icon.png so that it OF icon should appear correctly in the custom wizard menu. I’m not sure what was wrong with it, hopefully it should work fine now.

btw, the ofProject script will dissappear for 007, the new createProjects.py script is much simpler and has support for both makefile and non makefile based cbps in case you want to change the wizard. we can include it in the official package

Dear Arturo
Im not a python Programmer but, Im very interested in changing the Wizard under Ubuntu, adding Addons in CodeBlocks its too tough right now. I have oF 0.7. How can I do it using createProjects.py?