Handling the compiler and loader flags using qmake [SOLVED]
-
Hi,
I have to compile and link a Qt application which uses the GraphViz library. So I have to pass some flags to the compiler (g++) and the loader like this:
@
CFLAGS=pkg-config libgvc --cflags-Wall -g -O2
LDFLAGS=pkg-config libgvc --libs
@How can I pass those flags through the qmake file ?
thnks in advance.
-
Hi,
Have a look at the qmake Project file manual page, it shows how to use pkg-config with Qt's pro files
-
You should really use the PKGCONFIG variable, it will avoid you to modify these flags by hands
-
You avoid to have to set both QMAKE_CXXFLAGS and QMAKE_LFLAGS for each library you add through it
-
What do you mean ?
-
PKGCONFIG contains the list of the library that you want to build against/link to and this content will be fed to the pkg-config command to retrieve the include paths and link flags.
Note that the libraries you list there must provide a pc file (most do)