Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

qmake : Build library without the symlinks and 'lib' prefix

I require a very simple mechanism in my application, where my project is built as a shared library '.so' or '.dll', but what I want is:

ExampleAppOne.so

I get:

libExampleAppOne.so -> libExampleAppOne.so.1.0.0
libExampleAppOne.so.1 -> libExampleAppOne.so.1.0.0
libExampleAppOne.so.1.0 -> libExampleAppOne.so.1.0.0

I don't even want the 'lib' prefix. In the .pro file, all I can do is change the INSTALLS variable (that is because my third requirement IS that the library be built in a specific directory).

Also, I have a fourth, related requirement: When I ask QLibrary to load the library, I want it to specifically search for a library in a very specific path and a library that matches the EXACT name given to it. No 'lib' prefix matching, no 'version string' searching, no looking into LD_LIBRARY_PATH...

Any help is appreciated.

Regards, rohan

like image 785
Rohan Prabhu Avatar asked May 23 '11 18:05

Rohan Prabhu


2 Answers

add the following to you .pro file

# disables the lib prefix
CONFIG += no_plugin_name_prefix
# disable symlinks & versioning
CONFIG += plugin
like image 77
lumos0815 Avatar answered Nov 15 '22 14:11

lumos0815


Adding plugin to the CONFIG variable should disable versioning and the generation of symbolic links to the library.

I don't know of a simple way to disable the lib prefix though. You way want to dig into the provided QMake spec files to see how the default processing is implemented.

like image 36
Jonathan Perret Avatar answered Nov 15 '22 16:11

Jonathan Perret