tags:

views:

321

answers:

3

I have a (partial) qmake project file like this:

TEMPLATE=lib
TARGET=whatever
SOURCES=whatever.cpp
HEADERS=whatever.h

This will - atleast by default - create a library and few symbolic links like this:

libwhatever.so -> libwhatever.so.0.1.0
libwhatever.so.0 -> libwhatever.so.0.1.0
libwhatever.so.0.1 -> libwhatever.so.0.1.0
libwhatever.so.0.1.0

libwhatever.so.0.1.0 is the actual library binary, rest of them are just symbolic links.

What i would like to archive is that no symbolic links are created at all or the order what be other way around so that libwhatever.so would be the actual binary and rest are the symbolic links.

A: 

It might help if you gave us some hint as to why it matters...

As for how, you might consider a script that will rearrange things to your liking that is run at the end of the build process.

Caleb Huitt - cjhuitt
Reason why i want such behaviour is due to some software packaging reasons. I know how to get around those so the reason is actually irrelevant. The real reason is that qmake itself is just too undocumented and i asked this question in order to find out if this behaviour could be reconfigured without any "hacks".
rasjani
+1  A: 

I studied the qmake sources and the mkspecs, but it seems that the generation of the symbolic links is rather hardwired.

From what I found in the sources, it seems that if you add plugin to CONFIG, only the library will be generated, without the symbolic links.

I can't tell you if doing so has any other side effects, though. But it seems to be the only way to get rid of the symbolic links without having to write a script that runs after building.

BastiBense
Excellent workaround! Allthou as you say, it might add some more linking flags into the resulting binary. As atleast qt itself doesn't allow mixing of actual plugins if they have been compiled with different set of arch flags that would propably still be working one on the os level. I need to check this..
rasjani
Thanks! I tested adding CONFIG += plugin to a few of my own projects, but it seems that it causes weird behavior. I suggest writing a script to clean up. In fact, I use a "distribution script" that packs everything that is required into a target archive/disk image, so that symbolic links aren't really a problem.
BastiBense
A: 

If you override the QMAKE_LN_SHLIB variable with a no-op, it will not make the symbolic links.

QMAKE_LN_SHLIB       = :
swarfrat