Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Bug found in macdeployqt

Bug found in macdeployqt

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
macdeployqtmactools
3 Posts 2 Posters 1.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mcleary
    wrote on last edited by
    #1

    I was using the macdeployqt tool but I found an error when the tool tries to copy the Qt Plugins that my application depends on.

    The problem was that I am linking my application with VTK shared libraries and one of the libraries is called libvtkGUISupportQtOpenGL.dylib.

    Since this is a very small change to the code, I figured that it might save me some time to post here in the forums rather than building the entire Qt library in order to make a contribution. I found that the problem is in this file: https://github.com/qtproject/qttools/blob/dev/src/macdeployqt/shared/shared.cpp at line 853. Here is the problem

    // Get the qt path from one of the Qt frameworks;
    if (deploymentInfo.qtPath.isNull() && framework.frameworkName.contains("Qt")
                && framework.frameworkDirectory.contains("/lib"))
    {
           deploymentInfo.qtPath = framework.frameworkDirectory;
           deploymentInfo.qtPath.chop(5); // remove "/lib/"
    }
    

    In this case, the macdeployqt tool thinks that libvtkGUISupportQtOpenGL.dylib. is a Qt framework and sets the deploymentInfo.qtPath to the path of a VTK library, which has nothing to do with Qt Frameworks. At the end of the process, back in main.cpp it tries to copy the Qt Plugins from the same directory as libvtkGUISupportQtOpenGL.dylib thus rising an error.

    So I added a fourth condition in the line that check if the current framework being analysed is in fact a Qt Framework. This is the fix:

    // Get the qt path from one of the Qt frameworks;
    if (deploymentInfo.qtPath.isNull() && framework.frameworkName.contains("Qt") 
                && framework.frameworkName.contains(".framework")
                && framework.frameworkDirectory.contains("/lib"))
    {
           deploymentInfo.qtPath = framework.frameworkDirectory;
           deploymentInfo.qtPath.chop(5); // remove "/lib/"
    }
    

    I am currently using a fork of the macdeploytool, hope this can make its way to the official code!

    1 Reply Last reply
    0
    • jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      I think it would be better to raise a bug report

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply
      0
      • jsulmJ jsulm

        I think it would be better to raise a bug report

        M Offline
        M Offline
        mcleary
        wrote on last edited by mcleary
        #3

        @jsulm You're right. I don't know why I didn't think of that

        I filled in a bug report regarding this issue here: https://bugreports.qt.io/browse/QTBUG-51728

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved