I am trying to add a library dependency to my .pro file, so that it will compile the library when necessary.
For instance, in my source/qtshared library, I successfully created a .pro file with the 'lib' TEMPLATE. This creates a static library called libqtshared.a.
I have another directory called source/qtcomms, in which I create a .pro file with the 'app' TEMPLATE. This includes the library ../qtshared/libqtshared.a
When libqtshared.a actually exists, I have no problems compiling my app in the qtcomms area. However, when this library does not exist, I want my make to be smart enough to know to compile libqtshared.a based on the makefile (generated by qmake).
In my qtshared.pro the important variables are:
TEMPLATE = lib.
CONFIG += staticlib create_prl #(not sure if the 2nd variable is necessary)
In my qtcomms.pro the important variables are:
TEMPLATE = app
DEPENDPATH += ../qtshared
INCLUDES += . ../qtshared
LIBS += -L../qtshared -lqtshared
CONFIG += link_prl #(not sure if this is needed or not)
I know I can also do a top level .pro file in my source area with the 'subdirs' TEMPLATE, but I would rather have a sufficient makefile actually within my qtcomms area so I can compile it individually.
Any help is greatly appreciated. Thanks.
Bookmarks