PDA

View Full Version : QMake static and shared build at the same time



rubenvb
14th March 2010, 15:31
Hi,
I can't seem to get this to work right:
I'd like qmake to generate dll+import lib and static lib all at the same time (2x compilation of course)
I'm talking about output files like unix libs built from msys with configure:
library.dll
liblibrary.dll.a
liblibrary.a

I'd like to get the same result from "qmake && mingw32-make all". Perhaps maybe "make dll" and "make static" to differentiate.

Is this possible with qmake?

Thanks

ktk
19th March 2010, 20:10
In one case you'd need CONFIG+=staticlib, in the other not. So create two build directories, and run plain 'qmake ; make ' from one, and 'qmake "CONFIG+=staticlib" ; make' from the other.

rubenvb
20th March 2010, 08:41
Right, I thought as much. But that still leaves me with one problem:
I'd like to have all the targets (built files) in the same directory structure, like so:

<project>/src - source files
<project>/lib - project.a static and project.dll.a import lib
<project>/bin - dll files and executables

The problem is that I haven't found a way for qmake to make the dynamic import lib named *.dll.a. Am I overlooking some option? Thanks