disable library versioning with qmake

October 20, 2010

For another project I am working on we use Qt as a portability layer and hence also qmake for our build tool. We are also utilizing some other open-source libraries such as lua and bullet for which we also use qmake. For lua our qmake project file looks (similar) like this:

TEMPLATE = lib
CONFIG += dll
TARGET = lua
DESTDIR = ../../../bin/
 
INCLUDEPATH += ./
 
SOURCES = print.c \
    lzio.c \
    lvm.c \
    lundump.c \
...

and the funny thing is that it creates in the destination folder three symbolic links with names liblua.so, liblua.so.1, and liblua.so.1.0 that all point to the file liblua.so.1.0.0. This is the case for every library, eg. libname would result in the links libname.so, libname.so.1, and libname.so.1.0 and the actual library would be libname.so.1.0.0.

This all is due to the versioning that qmake does automatically for the libraries (e.g. projects with CONFIG += dll).

Now to disable it, you have to add the keyword plugin to the CONFIG specification in your qmake project file:

TEMPLATE = lib
CONFIG += dll plugin
...

After doing so, all the links disappear and you end up with a single liblua.so (or libname.so) as one might want to have it in the first place.

Now that is done … back to work!

1 Comment