I am working on a custom library, and I want users to just be able to use it by adding:
CONFIG += mylib
to their pro files. This can be done by setting the file mylib.prf to% QTDIR% / mkspec / features. I checked Qt Mobility on how to create and install such a file, but there is one thing I would like to do differently.
If I correctly understood the pro / pri Qt Mobility files, in the sample projects they really do not use CONFIG + = mobility, instead they add QtMobility sources to include the path and share the * .obj directory with the main library project. For my library, I would like have examples that are as independent projects as possible, i.e. Projects that can be compiled from anywhere after compiling and installing MyLib.
I have the following directory structure:
mylib | |- examples |- src |- tests \- mylib.pro
It seems that the easiest way to achieve what I described above is to create mylib.pro as follows:
TEMPLATE = subdirs SUBDIRS += src SUBDIRS += examples tests:SUBDIRS += tests
And somehow force a call to "cd src && make install" after building src. What is the best way to do this?
Of course, any other suggestions for automatically deploying libraries before compiling the examples are welcome.
source share