PDA

View Full Version : how to set plugin install name via qmake



mentalmushroom
25th February 2016, 13:07
Hello. I am trying to create a dynamic library on Mac OS X. As long as I wanted to avoid "lib" prefix and versions, in the .pro file I specified the following:



CONFIG += plugin no_plugin_name_prefix


It did the job, but now I can't set it's install_name. For an ordinary dynamic library (not plugin) the following works:

QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../Frameworks/
In case of plugin it doesn't seem to do anything.

I was trying to do something like this:

QMAKE_POST_LINK += install_name_tool -id @executable_path/../Frameworks/$$TARGET <output-file>
But it doesn't works, because I have to refer to the output file, which is unknown (or at least, I didn't find any qmake variable for that).

Could somebody help me?

mentalmushroom
2nd March 2016, 16:02
Just in case someone is interested, I've managed to solve the issue the following way:

QMAKE_LFLAGS_PLUGIN += -Wl,-install_name,@executable_path/../Frameworks/$${TARGET}.$${QMAKE_EXTENSION_SHLIB}


Unfortunately, in contrast to what QMAKE_LFLAGS_SONAME does for an ordinary library, this way the install_name doesn't get prefixed but is totally replaced, i.e. it is necessary to specify the target file name. I haven't found a way to do that, therefore $${TARGET}.$${QMAKE_EXTENSION_SHLIB} is used as a workaround. Let me know if there is a better way to do that.