First of all, qmake documentation is pretty lacking, so no blame on you ;) 
Especially the CONFIG variable feels pretty magic sometimes, because it mixes 
several mutually exclusive options, and of these always the last to appear is 
effective. E.g. (debug, release, debug_and_release) and (static, shared, 
static_and_shared).
So, CONFIG+= static_and_shared should do your trick (if CONFIG doesn't get a 
static or shared appended later).

As a side note, if you have two .pro files that would need to use the same 
source+header files, the "usual" approach is to put the HEADERS and SOURCES 
sections into a .pri file, and include that in your two .pro files.

foo.pro:
TEMPLATE = subdirs
SUBDIRS+=foo_blah.pro foo_blubb.pro

foo_blah.pro:
include(foo_include.pri)
[... more ...]

foo_blubb.pro:
include(foo_include.pri)
[... more ...]

foo_include.pri:
SOURCES+=$$PWD/source1.cpp $$PWD/source2.cpp
[... more ...]

--
Eike Ziller
Principal Software Engineer

Nokia, Qt Development Frameworks

Nokia gate5 GmbH
Firmensitz: Invalidenstr. 117, 10115 Berlin, Germany
Registergericht: Amtsgericht Charlottenburg, Berlin: HRB 106443 B
Umsatzsteueridentifikationsnummer: DE 812 845 193
Geschäftsführer: Dr. Michael Halbherr, Karim Tähtivuori
________________________________
From: [email protected] 
[[email protected]] on behalf of ext 
Jonathan S. Shapiro [[email protected]]
Sent: Thursday, May 31, 2012 01:24
To: Coda Highland
Cc: [email protected]
Subject: Re: [Qt-creator] Theory of Operation question concerning configurations

That definitely won't work. The .o files for the two types of libraries are 
typically generated using very different compile options.

On Wed, May 30, 2012 at 12:43 PM, Coda Highland 
<[email protected]<mailto:[email protected]>> wrote:
On Wed, May 30, 2012 at 2:24 PM, Jonathan S. Shapiro 
<[email protected]<mailto:[email protected]>> wrote:
> I understand the solution that uses multiple ".pro" files, but this approach
> doesn't seem to interact happily with QtCreator. What QtCreator sees in this
> case is two projects, with the result that source files need to be added to
> both of them.

You missed my point on the second one -- the second project contains
NO source files but rather only performs linking. Qt Creator should
display this as an empty subproject but I THINK it should still do the
trick -- although you may need to point to the static lib by path in
OBJECTS instead of with a LIBS += -l directive.

/s/ Adam


_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/qt-creator

Reply via email to