qmake template
Write a buildsystem is always the first step (and sometimes the most boring) when starting a new software project. Qt provides it’s own tool in order to make a single build tree work properly in all supported platforms: qmake. Instead of create a qmake structure from scratch for your brand new project, this template aims to give you a solid base to rely upon, meeting some basic requirements:
Shadow build – No dirty source tree anymore after compiling your code. Build your code inside your tree is optional, you just need to create a build directory and call your project’s configure script instead. There are many situations when this is specially necessary: building the same tree for different platforms or when you source code is located on a slow storage device (such as network drives and encrypted partitions).
Automated tests integration – Test driven development is being more common every day and has proven to be an important tool to detect regressions. This qmake template provides more then a simple way to run your tests (by typing “make check”), but a visual report of your tests coverage using LCOV.
Code documentation – Developers are mostly lazy when writing documents, but not if you provide a easy and beautiful way to check the results of good written code documentation. After hitting “make doc”, a HTML page is automatically generated gathering all information extracted from qdoc3 markups of your source files. Compare the result with the original file.
Localization support – A modern buildsystem must provide a clever way of translators update the language files. We must remember that translators aren’t necessarily developers and they may not want to dig your code looking for translatable strings. This template provides integration with lupdate and lrelease i18n tools of Qt framework, creating all .ts files necessary to Qt Linguist.
Debugging friendly – This is quite obvious: a build system must be able to generate a debug release. And you also don’t need to install your software (at least in a Linux box) in order to run a quick and dirty test, due to some tricky linker flags.
Packaging – Your software must be redistributable, so we added a Debian packaging example to this template to demonstrate how packable this buildsystem is, specially for Debian-based system. Does anyone want to contribute with the RPM packaging?
Final considerations
I haven’t made tests on others platforms but Linux. I’m pretty sure of unless you are using GCC, some features such as unit tests coverage report cannot be done with the current implementation.
The latest templete snapshot is available for download here. You can also browse the git repository. Please remember: patches and suggestions are welcome.
More information about usage can be found at the BUILD file in the git repository.
In: article, devel, en, nerd, pt_br · Tagged with: buildsystem, qmake, qt
Qt Mainstream Debian Packages
For those who want to test a preview of Qt 4.6 with it’s recently merged animation framework and state machine, I did some patches using the packages maintained by the Debian KDE team in order to build the Qt repository HEAD. I did only few tests with these packages and seems to work fine at this moment. You should note if you install the 4.6 packages, they will replace your system packages. It’s a completely reversible operation, but I must warn you that it may break some applications such as the whole KDE and Skype, because these packages were built from a unstable tree.
If you are brave enough, build your own pacakges with these patches.
In: devel, en, linux, pt_br · Tagged with: debian, qt
Geek Pride Day
Today is Geek Pride Day. I already received greetings from friends, girlfriend, relatives, etc. Two years ago I’ve made a test to find out my nerdness level. At that time my score was 55. If I remember correctly, I was a “Nerd Light” according to the test. Today, I did the test again to see how I’m evolving.
By the way, I would like to congrats you, because if you are reading this blog, you probably is a nerd too.





