[Qt-creator] qmake and backtick command arguments

Andrzej Telszewski atelszewski at gmail.com
Mon Feb 22 12:31:19 CET 2016


On 22/02/16 12:24, Nikos Chantziaras wrote:
> On 22/02/16 12:41, Andrzej Telszewski wrote:
>> 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
>
> "-isystem" is actually the recommended flag for specifying system
> include files. See:
>
>
> https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html#Directory-Options
>
> So it seems qmake is being smart here and does the correct thing.
 >

That was what I though.

> If you
> want to also cover the case where php-config might use "-isystem"
> instead of "-I" on some machines, you can just replace that too:
>
>    PHP_INCLUDEPATH = $$system(php-config --includes)
>    PHP_INCLUDEPATH = $$replace(PHP_INCLUDEPATH, "-I", "")
>    PHP_INCLUDEPATH = $$replace(PHP_INCLUDEPATH, "-isystem", "")
>

Good idea.

> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qt-creator
>


-- 
Best regards,
Andrzej Telszewski



More information about the Qt-creator mailing list