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, the rest of them are just symbolic links.
What i would like to achieve 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.
You can add below to your pro file:
CONFIG += unversioned_libname unversioned_soname
I have tested succeed.
If you override the QMAKE_LN_SHLIB variable with a no-op, it will not make the symbolic links.
QMAKE_LN_SHLIB = :
I tried to suggestion posted by swarfrat and it works but it outputs an error with a (rather helpful) message:
Error 1 (ignored)
So, here is another way of deleting the symlinks without generating any errors:
unix: QMAKE_POST_LINK = find $$DESTDIR -maxdepth 1 -type l -exec rm -f {} \;
More information about this qmake variable can be found here.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With