[Qt-interest] qmake: setting INCLUDEPATH from a shell command output

Islam Samir Badreldin islam.badreldin at gmail.com
Sat Feb 14 19:56:40 CET 2009


Miguel Cardenas wrote:
> Hello list
>
> Am porting a console application to Qt but have troubles adding MySQL 
> includes and libraries to the Qt .PRO configuration...
>
> In the console version just had to add to the Makefile something like:
>
>      INCLUDES = `mysql_config --include` ...
>      LIBS = `mysql_config --libs` ...
>
> in the .PRO configuration file I have:
>
>      INCLUDEPATH += `mysql_config --include`
>
> but it is interpreted as two strings separated by a space and it is 
> expanded as
>
>      -I`mysql_config -I--include`
>
> that should be
>
>      -I`mysql_config --include`
>
> and obviously compilation fails.
Hello Miguel,

Try this


MYSQL_INCLUDES = $$system(mysql_config --include)
INCLUDEPATH += $$MYSQL_INCLUDES

Or shortly
INCLUDEPATH += $$system(mysql_config --include)

I didn't try it myself and I don't know if it will work or not!! I am 
new to Qt and am just making my way through the documentation. Check 
this for more details:
http://doc.trolltech.com/4.4/qmake-function-reference.html#system-command

Hope it works!

Regards,
Islam



More information about the Qt-interest-old mailing list