Results 1 to 2 of 2

Thread: how to set plugin install name via qmake

  1. #1
    Join Date
    Feb 2011
    Posts
    354
    Thanks
    17
    Thanked 26 Times in 23 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default 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:

    Qt Code:
    1. CONFIG += plugin no_plugin_name_prefix
    To copy to clipboard, switch view to plain text mode 

    It did the job, but now I can't set it's install_name. For an ordinary dynamic library (not plugin) the following works:
    Qt Code:
    1. QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../Frameworks/
    To copy to clipboard, switch view to plain text mode 
    In case of plugin it doesn't seem to do anything.

    I was trying to do something like this:
    Qt Code:
    1. QMAKE_POST_LINK += install_name_tool -id @executable_path/../Frameworks/$$TARGET <output-file>
    To copy to clipboard, switch view to plain text mode 
    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?
    Magicians do not exist

  2. #2
    Join Date
    Feb 2011
    Posts
    354
    Thanks
    17
    Thanked 26 Times in 23 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default 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:
    Qt Code:
    1. QMAKE_LFLAGS_PLUGIN += -Wl,-install_name,@executable_path/../Frameworks/$${TARGET}.$${QMAKE_EXTENSION_SHLIB}
    To copy to clipboard, switch view to plain text mode 

    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.
    Magicians do not exist

Similar Threads

  1. QT dynamic build "qwindows" identification problem
    By uzairsaeed702 in forum Installation and Deployment
    Replies: 2
    Last Post: 16th December 2014, 20:07
  2. Replies: 0
    Last Post: 27th August 2010, 08:05
  3. Mac button identification
    By Caius Aérobus in forum Qt Programming
    Replies: 2
    Last Post: 6th April 2009, 15:02
  4. getting qmake to make the plugin
    By illuzioner in forum Qt Tools
    Replies: 7
    Last Post: 6th June 2007, 16:49
  5. rotation and mouse event identification
    By kiransu123 in forum Qt Programming
    Replies: 2
    Last Post: 14th March 2007, 04:41

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.