PDA

View Full Version : another qmake INCLUDEPATH spaces problem



mmueller
30th July 2008, 06:45
In order to include some linux kernel .h files in my app, I'd like to add the following to my INCLUDEPATH in the .pro file:

INCLUDEPATH += /usr/src/kernels/$(shell uname -r)/include

Unfortunately what appears in the Makefile is this:

-I/usr/src/kernels/$(shell\ uname\ -r)/include

qmake is escaping the spaces which is causing the "shell uname -r" to not work within make. Placing the string in double quotes resolves the escaping issue, but also causes qmake to treat spaces as a delimiter and thus preface everything with a -I.

Is there a way to get around this w/qmake 2.01a?

Thanks for any help,
Mark

jpn
30th July 2008, 08:05
How about using qmake's built-in system() (http://doc.trolltech.com/4.4/qmake-function-reference.html#system-command) function?

INCLUDEPATH += /usr/src/kernels/$$system(uname -r)/include

mmueller
30th July 2008, 19:11
How about using qmake's built-in system() (http://doc.trolltech.com/4.4/qmake-function-reference.html#system-command) function?

INCLUDEPATH += /usr/src/kernels/$$system(uname -r)/include

Sure, that does work but it forces the Makefile to be Kernel specific. My hope was to be able to build on different kernels without needing to generate a new Makefile.

Mark

jpn
31st July 2008, 13:40
Looks d*mn ugly but should work:


INCLUDEPATH += /usr/src/kernels/$(shell$${LITERAL_WHITESPACE}uname$${LITERAL_WHITE SPACE}-r)/include

mmueller
31st July 2008, 14:12
Not as ugly as some things I tried. It works brilliantly, and is much appreciated!

Mark