I'm working on custom library and I wish users could just use it by adding:
CONFIG += mylib
to their pro files. This can be done by installing mylib.prf file to %QTDIR%/mkspec/features. I've checked out in Qt Mobility project how to create and install such file, but there is one thing I'd like to do differently.
If I correctly understood the pro/pri files of Qt Mobility, inside the example projects they don't really use CONFIG += mobility, instead they add QtMobility sources to include path and share the *.obj directory with main library project. For my library I'd like to have examples that are as independent projects as possible, i.e. projects that can be compiled from anywhere once MyLib is compiled and installed.
I have following directory structure:
mylib
|
|- examples
|- src
|- tests
\- mylib.pro
It seems that the easiest way to achieve what I described above is creating mylib.pro like this:
TEMPLATE = subdirs
SUBDIRS += src
SUBDIRS += examples
tests:SUBDIRS += tests
And somehow enforce invoking "cd src && make install" after building src. What is the best way to do this?
Of course any other suggestions for automatic library deployment before examples compilation are welcome.