How to invoke make install for one subdirectory of Qt project

Posted by chalup on Stack Overflow See other posts from Stack Overflow or by chalup
Published on 2010-05-13T19:40:46Z Indexed on 2010/05/13 19:44 UTC
Read the original article Hit count: 202

Filed under:
|
|
|

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.

© Stack Overflow or respective owner

Related posts about qt

Related posts about qt4