Results 1 to 5 of 5

Thread: another qmake INCLUDEPATH spaces problem

  1. #1
    Join Date
    Jul 2008
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default another qmake INCLUDEPATH spaces problem

    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

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: another qmake INCLUDEPATH spaces problem

    How about using qmake's built-in system() function?
    Qt Code:
    1. INCLUDEPATH += /usr/src/kernels/$$system(uname -r)/include
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  3. #3
    Join Date
    Jul 2008
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: another qmake INCLUDEPATH spaces problem

    Quote Originally Posted by jpn View Post
    How about using qmake's built-in system() function?
    Qt Code:
    1. INCLUDEPATH += /usr/src/kernels/$$system(uname -r)/include
    To copy to clipboard, switch view to plain text mode 
    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

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: another qmake INCLUDEPATH spaces problem

    Looks d*mn ugly but should work:
    Qt Code:
    1. INCLUDEPATH += /usr/src/kernels/$(shell$${LITERAL_WHITESPACE}uname$${LITERAL_WHITESPACE}-r)/include
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  5. The following user says thank you to jpn for this useful post:

    mmueller (31st July 2008)

  6. #5
    Join Date
    Jul 2008
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: another qmake INCLUDEPATH spaces problem

    Not as ugly as some things I tried. It works brilliantly, and is much appreciated!

    Mark

Similar Threads

  1. Qt 4.3.1 & MinGW 5.1.3 & MSYS 1.0 qmake problem
    By mdecandia in forum Installation and Deployment
    Replies: 2
    Last Post: 2nd October 2008, 16:52
  2. A problem about qmake in Qt 4.4
    By alban_gt in forum Qt Programming
    Replies: 3
    Last Post: 24th July 2008, 17:19
  3. I have a problem about qmake
    By wsinw in forum Installation and Deployment
    Replies: 3
    Last Post: 29th May 2007, 12:04
  4. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57
  5. qmake INCLUDEPATH with spaces
    By bitChanger in forum Qt Programming
    Replies: 8
    Last Post: 28th April 2006, 05:39

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.