[Qbs] darwin - Installing DynamicLibrary (Framework) dependencies on the resulting bundle

Nuno Santos nunosantos at imaginando.pt
Mon Oct 23 10:07:08 CEST 2017


Jake,

Thanks for your reply.

So… what are my options then? Can I link the libraries without being Frameworks, have them installed to my product output dir and link them and use them with my application?

While I have already managed to create a lib from my shared resources, which depends on other libs, I still couldn’t use this shared lib in a small test project. It always fails when running because it can’t find the libraries. Yesterday I have also tried to make them static libraries without success.

So far I was trying to setup this libs as DynamicLibrary with as a bundle. I have now removed the bundle dependency and property but it also didn’t worked.

This is what I have at the moment:

// workspace/qbs-app-test/qbs-app-tes.qbs - generated by QtCreator

import qbs

Project {
    references: ["../shared/shared.qbs"]
    minimumQbsVersion: "1.7.1"

    CppApplication {
        Depends { name: "Qt.core" }
        Depends { name: "Qt.quick" }
        Depends { name: "shared” } // << this is my shared library dependency
        property pathList qmlImportPaths: []
        cpp.cxxLanguageVersion: "c++11"

        cpp.defines: ["QT_DEPRECATED_WARNINGS"]

        files: ["main.cpp", "qml.qrc"]

        Group {
            fileTagsFilter: product.type
            qbs.install: true
            qbs.installSourceBase: product.buildDirectory
        }
    }
}

// workspace/shared/shared.qbs

import qbs

Project {
    name: "shared"
    references: [
        "external/3rd-party-lib-1/3rd-party-lib-1.qbs",
        "external/3rd-party-lib-2/3rd-party-lib-2.qbs"
    ]

    DynamicLibrary {
        Depends { name: "cpp" }
        cpp.includePaths: [".", "external/", "external/3rd-party-lib-1", "external/3rd-party-lib-2"]
        cpp.frameworks: ["CoreFoundation", "AppKit", "IOKit"]
        Depends { name: "parseqt" }
        Depends { name: "dsp" }
        Depends { name: "Qt"; submodules: ["core", "gui", "qml", "network", "quick"] }
        files: [...]

        Export {
           Depends { name: "cpp" }
           cpp.includePaths: [product.sourceDirectory]
        }
    }
}


When I run the project right now this is what happens:

dyld: Library not loaded: 3rd-party-lib-1.framework/Versions/A/3rd-party-lib-1
  Referenced from: /Users/nsantos/workspace/build-qbs-app-test-Desktop_Qt_5_7_1_clang_64bit2-Debug/qtc_Desktop_Qt_5_7_1_clang_64bit2_Debug/install-root/Library/Frameworks/shared.framework/Versions/A/shared
  Reason: image not found
The program has unexpectedly finished.


What am I missing here?

Thanks!

Regards,

Nuno

> On 23 Oct 2017, at 01:43, Jake Petroules <Jake.Petroules at qt.io> wrote:
> 
> Yes, framework embedding is not yet supported, although this is a high priority item for a future release. It may not make THE next release in part because we want to make sure the solution is general enough to be applicable to other platforms as well, such as embedding libraries into Android APKs.
> 
>> On Oct 22, 2017, at 3:17 PM, Nuno Santos <nunosantos at imaginando.pt> wrote:
>> 
>> Hi,
>> 
>> I’m trying to a application project depend on custom set of libraries. The libraries are referenced on the project and marked as dependencies. The project builds but crashes on launch because the dependencies are not copied as frameworks to the resulting bundle. Is this a limitation of qbs at the moment? 	
>> 
>> qbs 1.9.1 / Qt 5.7.1 / Mac OSX 
>> 
>> Thx
>> 
>> Regards,
>> 
>> Nuno
>> _______________________________________________
>> Qbs mailing list
>> Qbs at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/qbs
> 
> -- 
> Jake Petroules - jake.petroules at qt.io
> The Qt Company - Silicon Valley
> Qbs build tool evangelist - qbs.io
> 




More information about the Qbs mailing list