CodeLite template

Hi

**[UPDATE] I made a custom projectGenerator that supports creating codelite projects. You can check it out here: https://github.com/underdoeg/openFrameworks/tree/feature-pg-codelite-linux**

On ubuntu, I prefer the c++ IDE CodeLite (http://codelite.org/) over Code::Blocks. Mostly because it is very clean, simple and has great code generation tools built in.

So I adapted an empty workspace with just one emptyExample (the recent github version) in it to compile in CodeLite. Download it here, if you want to give it a try: http://www.underdoeg.com/uploads/OFcodeLite.tar.gz. Just unpack the files and place the codeLite folder in your apps folder. The workspace was made for linux, but I guess with some tweaking it should be easy to compile on mac or windows as well.

EDIT: I changed the templates to use the openframeworks makefiles. Download this version: http://www.underdoeg.com/uploads/OFcodeLiteMake.tar.gz The other one is obsolete, but I keep it online, just in case…

You can right click on the emptyExample project and then save it as a template to easily create other projects.

I also replaced most of the default CodeLite icons with the fugue iconset. Mostly because they have sharper edges and a cleaner design. So my CodeLite environement now looks like this:

I still want to get rid of the plus and home signs as well as the a little bit massive close tab icons, but you can download the icon pack here: http://www.underdoeg.com/uploads/codelite-icons.zip. Don’t unzip it, just place the zip file in /usr/share/codelite

I hope this is useful for somebody.

lg.ph

are you using the makefiles?or have setup everything in the codelite project settings?

It’s all set up using the CodeLite project settings…

i’ve been thinking in moving codeblocks to use makefiles, it makes it easier for me to set it up : ) but also to configure projects for everyone. for example to add an addon, you just need to add a line in the addons.make file. then add the files to the project if you want to see the code, but that’s it no search paths or libraries, everything is figured out automatically by the makefile. it doesn’t even need install.xml files just that the addon has the same filesystem structure as the official ones.

i’ve also added a config.make file to easily add search paths, libraries or compiler flags that is what most people would need to use in case addons is not enough.

but anyway, will take a look. i looked into it a while ago but there was some problems that perhaps have been fixed. if adding files is easier than in codeblocks i’m all for it : )

Yes, I’m also not entirely happy with the way you have to add existing files in CodeLite. Mostly because you can’t really keep the folder structure intact. But after some trial and error, I now have a workflow that works for me. But apart from that, I’m quite happy with the editor, where everything is placed etc.

I have to admit, that I am not too familiar on how makefiles work exactly, but your plan sounds pretty good. I guess that means we could maintain project templates for most IDEs relying on those makefiles? So that they should all be up to date, as soon as the makefiles change?

I guess it wouldn’t even be too hard to write a little CodeLite plugin that lists all folders in the addon directory and then adds the names of the ones you select to the addons.make file? Just a random thought… :slight_smile:

I have to admit, that I am not too familiar on how makefiles work exactly, but your plan sounds pretty good. I guess that means we could maintain project templates for most IDEs relying on those makefiles? So that they should all be up to date, as soon as the makefiles change?

yes, that’s the idea, i usually use eclipse and i know in linux at least there’s people using other ides or even just text editors with the makefiles so this way giving support for several IDEs is much easier and updating just requires to modify almost 1 file instead of 1 per project

I guess it wouldn’t even be too hard to write a little CodeLite plugin that lists all folders in the addon directory and then adds the names of the ones you select to the addons.make file? Just a random thought… :slight_smile:

yes i was thinking of something like that for codeblocks, i just dont know why they make it so difficult. it would be so easy to just saw everything below a folder…

anyway, if you look at any of the config.make files in the examples there’s instructions on how to use them. And the emptyExample codeblocks project is already setup to use makefiles

Great. I’ll look at the make files and post my progress here. I guess for beginners on linux it’s easier to have a premade project for an IDE you can simply open in a GUI than to work with make files directly. Although I like the process of just writing “make” in the console and all the text flies by :wink:

well the idea is that beginners won’t even notice that it’s working with a makefile, at least in codeblocks they can use it exactly as before. the only difference is now to setup addons you need to edit addons.make and to add libraries or search paths you will edit config.make. you don’t really need to touch the makefile at all just tell the IDE to use it which for codeblocks will be already done

The makefile build system approach is convincing! I adapted the template to use them as well. Thanks for pointing it out

underdoeg.com/uploads/OFcodeLiteMake.tar.gz

I created a little application to automate the process of creating a new codelite project based on standard makefiles. You can download it here. It is really basic and I guess we could use it for the ofGenerate.py scripts as well.

You can download it here
https://github.com/underdoeg/ofProjectMaker-for-CodeLite#readme

Codelite integration now works as well

hehe, that looks nice. does that use wxwidgets?

great! so maybe we can drop python dependencies? on linux this is ok, but on windows its really hard and annoying to install python and setuptools and so on.

@bilderbuchi Yes. It uses wxWidgets.

@benben you’re right it is annoying on windows. But actually this app uses it as well. It’s a wrapper to a python script I wrote before I knew I was going to make a gui for it. But I guess it wouldn’t be too hard to port the script to c++. But we’d still need the generateProjects.py script to create all projects, dependencies etc on windows I guess? And those have a little more code in them.

But maybe we could just integrate python inside this c program. That’s not too hard to archive. Then we’d have some sort of python runtime with a gui. Just far fetching right now… :wink: But python is a nice language to program stuff like copy files, search replace contents etc…

Hi, I just wanted to update this thread to inform that codelite has had some updates and file handling is much better now. You can import nested directory structures and they are left intact with each file in its place. That was the last major flaw in the software IMO and I think it is now one of the best c++ editors for linux and windows. Only mac version is a little wobbly…

that sounds really good: that’s for me one of the major problems with code blocks. will look into it, perhaps we can have code lite as the official supported ide for next releases

Nice. Additionally, it seems to support code formatting with AStyle, so that’s another plus (although c::b does that, too)

Yes, I think code formatting is similar to code::blocks

Arturo, I think supporting codelite would be a big plus. With the makefiles it’s not that much of a hustle to do so and I already have the codelite templates and a python script to generate them. It’s basically a template workspace and project where you have to replace some names. You can checkout the script and template here: https://github.com/underdoeg/ofProjectMaker-for-CodeLite/tree/master/share/ofMaker It’s not perfect but works for me.