how to set plugin install name via qmake
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:
Code:
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:
Code:
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:
Code:
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?
Re: how to set plugin install name via qmake
Just in case someone is interested, I've managed to solve the issue the following way:
Code:
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.