qbs: DynamicLibrary under MacOS



  • Gentleman,

    I am trying to deploy a Windows/Linux project for MacOS.
    Everything is working except for the ".framework" files not being installed into the "install-root" folder.

    On Windows the "install-root" looks roughly like this:
    mylib.dll
    myapplication.exe

    On MacOC the "install-root" looks like this:
    mylib
    myapplication

    When running the application it will not run due to missing "mylib.framework"

    The ".framework" file is present but remains in the build folder for the library. When manually transferring the file to the "install-root" folder the application will start successfully.

    What keeps me up and led me to signing up and writing this post is that I can't find any documentation on what qbs actually does when "installing" the librarys. From my point of view the ".framework" is somehow forged into a binary package which can not be interpreted by the OS.

    Following screenshots are all stripped down to the relevant files to demonstrate the issue.

    install-root
    install-root

    build folder
    build-folder

    working setup
    working

    The qbs file is simply setup as this:

    DynamicLibrary {
    ...
        Group  {
            name: "Install"
            qbs.install: true
            qbs.installDir: "bin"
            fileTagsFilter: "dynamiclibrary"
        }
    ...
    

    Please let me know if I need to be more specific on any topic.
    Thank you very much for any input!


  • Moderators

    Hi! I'm not familiar with macOS, but I found a page in Qbs' manual that might be of interest: http://doc.qt.io/qbs/bundle-module.html



  • Thank you very much Wieland!

    The hint I needed was the bundles.

    For someone finding this post with the same issue, here is my solution:

        Group {
            fileTagsFilter: ["dynamiclibrary"]
            qbs.install: true
            qbs.installDir: bundle.isBundle ? FileInfo.joinPaths("bin", FileInfo.path(bundle.executablePath)) : "bin"
        }
    
        Group {
            fileTagsFilter: ["aggregate_infoplist"]
            qbs.install: bundle.isBundle && !bundle.embedInfoPlist
            qbs.installDir: FileInfo.joinPaths("bin", FileInfo.path(bundle.infoPlistPath))
        }
    

    Best regards,
    Andreas


  • Moderators

    Great! Thanks for sharing your solution!



Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.