View Full Version : RFC: A Complex(er) QMake Template

9th January 2007, 01:05

Since I sometimes like to work a whole lot, only so that I could work a little bit less later, I started playing with qmake and started to build some features and includes that allow me to work the way I like :-)

The result, after I now ripped it out of my project and build a little example template, can be found here (http://www.thecamel.de/template.tar.bz2). (Tested Qt = 4.2)

I probably have to admit that I am a reuse-neurotic, and it is very hard for me to write stuff that is only functional for a specific case. This often results in me writing libraries for stuff that could (but mostly are not :-/) be used again. The template allows this side by side development of the libs and the app without thinking, by using a few nice feature of qmake

a) .qmake.cache
At the root of the project the ".qmake.cache" grounds the project to a specific directory. Since qmake searches for this file and then loads it, it allows us to load a few default values. Since the directory the .qmake.cache is found in is also included in the search part for features, it at the same time allows us to add some nice features. (more on that later)

b) features
I created two little features, one that keeps all the temporary objects safely stacked away in a central place (separated by debug/release if you so care) since I really do not like the objects to lie around everywhere. And another that copies the headers that are specified by the variable PUBLIC_HEADERS into the directory $$includedir/$$targetname

The template contains a little example setup using a sub-project (a library) and a mainproject (an app) that can be very easily developed concurrently, as they check their dependencies automatically (tests are integrated into the template for good measure).

What do you guys/gals think?
Patches? ;-)

P.S. Since I do not trust "public domain" I made sure every file sports a BSD license so it can be used -- Overkill? ;-)

19th January 2007, 10:10
I have a comment - what does it actually do? There are lots of files in the archive, but none of them are really explained... You should at least attach some instructions on how to use it...