PDA

View Full Version : Adding 3rd Party framework path in pro file



munna
9th November 2009, 09:52
Hi,

I am trying to include an objective-c (on mac) based framework in my Qt based project. To do that based on the doc, I added the following lines in my pro file



QMAKE_LFLAGS += -F$$PWD/FrameWorkName/FrameWorkName.framework
LIBS += -framework FrameWorkName


But when I include the headers from this framework in my code in the following way


#include <FrameWorkName/SomeHeader.h>


I get error saying No such file or directory.

Also, if I place the framework in /Library/Frameworks directory use the following line in the pro file, everything works fine.


LIBS += -framework FrameWorkName


Can some one please explain how can I include framework in my Qt project from my project path itself and not from the root?

Thanks,
Mithin

caduel
9th November 2009, 10:12
includepath += ...
i wrote that in upper case but it keeps getting converted to lower case...

munna
9th November 2009, 10:25
I tried that too. But it doesn't work. The reason is, inside the framework's header files all the other headers are include in the following manner (there is a FrameWorkName prefix in all file included)



# include <FrameWorkName/SomeHeaderFile.h>


and the Directory structure of the framework is


/path/to/framework/Headers/HeaderFilesAreHere


Therefore, after including the INCLUDEPATH flag I get another File Not found error which is framework's some other header file.

Also, how does it work correctly if I place this framework inside /Library/Frameworks/?

caduel
9th November 2009, 10:33
when you write
# include <FrameWorkName/SomeHeaderFile.h>
then SomeHeaderFile.h has to be in a directory called FrameWorkName, and INCLUDEPATH should include /path/to/framework/Headers/ and the header themselves should be in /path/to/framework/Headers/FrameWorkName/*.h

munna
9th November 2009, 10:42
when you write
# include <FrameWorkName/SomeHeaderFile.h>
then SomeHeaderFile.h has to be in a directory called FrameWorkName, and INCLUDEPATH should include /path/to/framework/Headers/ and the header themselves should be in /path/to/framework/Headers/FrameWorkName/*.h

Yes, I understand this. But when I put the framework in /Library/Frameworks/FrameWorkName.framework directory, this above conditions specified by you are not met and still code compiles correctly and that is why I am trying to find out why is this not working when I set the framework path to be something other than /Library/Frameworks/FrameWorkName.framework

Any idea?