Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Bug found in macdeployqt

    Tools
    macdeployqt mac tools
    2
    3
    1253
    Loading More Posts
    • 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
      mcleary last edited by

      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 Reply Quote 0
      • jsulm
        jsulm Lifetime Qt Champion last edited by

        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 Reply Quote 0
        • M
          mcleary @jsulm last edited by mcleary

          @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 Reply Quote 0
          • First post
            Last post