[Qt-interest] How do I use frameworks with qmake on the Mac?
Nikos Chantziaras
realnc at arcor.de
Thu Jan 13 21:03:41 CET 2011
On 01/13/2011 09:06 PM, Bob Hood wrote:
> On 1/13/2011 11:15 AM, Nikos Chantziaras wrote:
>> The qmake docs:
>>
>> http://doc.qt.nokia.com/4.7-snapshot/qmake-platform-notes.html#using-frameworks
>>
>> state that:
>>
>> "qmake is able to automatically generate build rules for
>> linking against frameworks in the standard framework
>> directory on Mac OS X, located at /Library/Frameworks/"
>>
>> But unfortunately, it doesn't mention how. Right now, I have to
>> manually add the header files directories with:
>>
>> INCLUDEPATH += \
>> /Library/Frameworks/SDL.framework/Headers \
>> /Library/Frameworks/SDL_mixer.framework/Headers \
>> /Library/Frameworks/smpeg.framework/Headers \
>> /Library/Frameworks/SDL_sound.framework/Headers
>>
>> otherwise the application won't compile since #include can't find the
>> headers. And then link with:
>>
>> LIBS += -lSDL_mixer -lSDL_sound #etc, etc.
>
> AFAIK, you'll have to added the header folder to INCLUDEPATH, yes. For LIBS,
> the only other format I know of is something like this:
>
> LIBS += -framework CoreServices -framework Carbon
I'm using that syntax actually; I just copy&pasted the wrong line in my
OP :-P Anyway, "LIBS += -framework foo" is not automation. This is
just passed on to the linker as-is:
g++ [...] -framework foo
Exactly the same as with "LIBS += -lfoo" on Linux.
So nothing automatic here going on, which makes me wonder what the qmake
docs are referring to with "qmake is able to automatically generate
build rules"...
More information about the Qt-interest-old
mailing list