Pete855217
Pete855217

Reputation: 1602

Is it possible to build a Mac .framework in Qt using .pro file within Qt Creator?

Building a framework on Mac OSX is straightforward using XCode with its ready-made templates. I'm wondering whether there's a simple way to do the same thing ie. define the output of a Qt Creator build to be a framework by using the .pro file.

At the moment, I'm stuck building my libraries, then manually constructing the directory structure for a framework with the libs, headers and ./Current and ./Version directories.

Thanks guys

Upvotes: 1

Views: 1273

Answers (1)

Nikos C.
Nikos C.

Reputation: 51832

Yes. The functionality is offered by qmake. In your .pro file, you need:

TEMPLATE = lib
CONFIG += lib_bundle

This is documented here: https://doc.qt.io/qt-5/qmake-platform-notes.html#creating-frameworks

If you want the framework to be used for development, make sure the correct headers are copied to the bundle. QMAKE_BUNDLE_DATA is used for this.

Upvotes: 4

Related Questions