[Qt-creator] qmake and backtick command arguments

Andrzej Telszewski atelszewski at gmail.com
Mon Feb 22 11:41:00 CET 2016


On 22/02/16 11:26, Nikos Chantziaras wrote:
> On 22/02/16 12:17, Konstantin Tokarev wrote:
>> 22.02.2016, 11:55, "Nikos Chantziaras" <realnc at gmail.com>:
>>> On 22/02/16 10:45, Andrzej Telszewski wrote:
>>>>   On 22/02/16 09:39, Ziller Eike wrote:
>>>>>>   This yields yet another inconvenience. Using QMAKE_CFLAGS allows
>>>>>>   application to compile fine, but header files are not seen by Qt
>>>>>>   Creator and so cannot be nicely navigated.
>>>>>   Looks like Qt Creator handles QMAKE_CXXFLAGS, but not QMAKE_CFLAGS.
>>>>>
>>>>>   Br, Eike
>>>>
>>>>   OK, now I understand what you meant.
>>>>
>>>>   This works for navigation/browsing:
>>>>   QMAKE_CXXFLAGS += $$system(php-config --includes)
>>>>
>>>>   but this, does not work:
>>>>   QMAKE_CFLAGS += $$system(php-config --includes)
>>>
>>> INCLUDEPATH sets both of these automatically.
>>
>> But output of pkg-config-like tools is supposed to be directly fed
>> into compiler, e.g. if --includes output contains -isystem your code
>> will fail.
>
> Yes. The documentation says that it only emits "-I" options
>
>    http://php.net/manual/en/install.pecl.php-config.php
>
> but it might be lying, in which case QMAKE_C(XX)FLAGS is the defensive
> approach.
>

Well,

With:
QMAKE_CFLAGS += $$system(php-config --includes)

I get:
-I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM 
-I/usr/include/php/Zend -I/usr/include/php/ext 
-I/usr/include/php/ext/date/lib

and with:
PHP_INCLUDEPATH = $$system(php-config --includes)
PHP_INCLUDEPATH = $$replace(PHP_INCLUDEPATH, "-I", "")

INCLUDEPATH += \
   $$PHP_INCLUDEPATH

I get:
-isystem /usr/include/php -isystem /usr/include/php/main -isystem 
/usr/include/php/TSRM -isystem /usr/include/php/Zend -isystem 
/usr/include/php/ext -isystem /usr/include/php/ext/date/lib

The output of php-config --includes is:
$ php-config --includes
-I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM 
-I/usr/include/php/Zend -I/usr/include/php/ext 
-I/usr/include/php/ext/date/lib

-- 
Best regards,
Andrzej Telszewski



More information about the Qt-creator mailing list