johnbakers
johnbakers

Reputation: 24770

If you include a .pri, shouldn't that .pri's include path affect your #includes?

If I include(someOtherProject.pri) in my .pro, and that other project file (.pri) has INCLUDEPATH += . in it, then shouldn't my files in my .pro find those headers when I #include them? I cleaned and ran qmake on everything, regenerated the .pri file by simply copying the .pro from that other project and renaming it with the .pri extension, but when I #include a file from that other project, compiler says it cannot find it.

I wouldn't expect that I must also edit the INCLUDEPATH of my working .pro file if I am already using include(someOtherProject.pri) -- that would make the point of using include(someOtherProject.pri) unnecessary altogether.

Upvotes: 0

Views: 1748

Answers (1)

johnbakers
johnbakers

Reputation: 24770

The solution is to have INCLUDE PATH += $$PWD/ in the .pri instead, as this will expand out to the proper hard-coded path no matter where it is included.

Upvotes: 2

Related Questions