PDA

View Full Version : Add framework from a custom location



mentalmushroom
29th November 2013, 09:48
Hello

I use a third-party framework in my C++ application (namely, Sparkle.framework). I would like to place it in the lib folder nearby the .pro file instead of /Library/Frameworks/.

Here is my .pro file:


HEADERS += AutoUpdater.h

SOURCES += AutoUpdater.cpp main.cpp

mac {
HEADERS += SparkleAutoUpdater.h CocoaInitializer.h

OBJECTIVE_SOURCES += SparkleAutoUpdater.mm CocoaInitializer.mm

LIBS += -framework AppKit
LIBS += -framework Sparkle

QMAKE_LFLAGS += -F/$${PWD}/lib
}


After doing qmake -spec macx-xcode test.pro I see Sparkle.framework added to the list of external framework and libraries of the generated Xcode project. But when I try to build (I use Xcode 5.0.2), it fails at the line #include <Sparkle/Sparkle.h> of SparkleAutoUpdater.mm. The project builds fine when I place the Sparkle framework to /Library/Frameworks. Also it succeeds to build if I remove the OBJECTIVE_SOURCES from the .pro file and then manually add .mm sources to the Xcode project.

Could anybody help me about it?