jepessen
6th May 2011, 10:57
Hi.
I' m tring to include an external library to a .pro file.
To include this library when I compile in manual mode, I use the command
c++ -o test test.cpp `/mydir/libmesh-config --cxxflags --include --ldflags`
I use backquotes to have libraries path and so on. for example if I write
/mydir/libmesh-config --include
I obtain the list of includes in the form
-I/mydir/libmesh/include/base -I/mydir/libmesh/include/enums -I/mydir/libmesh/include/error_estimation -I/mydir/libmesh/include/fe -I/mydir/libmesh/include/geom -I/mydir/libmesh/include/mesh -I/mydir/libmesh/include/numerics -I/mydir/libmesh/include/parallel (and so on)
So I'd like to use this command in the .pro file instead of declaring every include path. The same for the --ldflags flag option that gives to me paths to libraries.
I've tried to write in the .pro file the following line, for example:
unix {
INCLUDEPATH += `/mydir/libmesh-config --include`
}
but it does not work (I get a "argument:: No such file or directory" error in qtcreator).
I'd like to know if it's possible to use this command to include libraries, instead of doing it by hand.
Thanks in advance.
I' m tring to include an external library to a .pro file.
To include this library when I compile in manual mode, I use the command
c++ -o test test.cpp `/mydir/libmesh-config --cxxflags --include --ldflags`
I use backquotes to have libraries path and so on. for example if I write
/mydir/libmesh-config --include
I obtain the list of includes in the form
-I/mydir/libmesh/include/base -I/mydir/libmesh/include/enums -I/mydir/libmesh/include/error_estimation -I/mydir/libmesh/include/fe -I/mydir/libmesh/include/geom -I/mydir/libmesh/include/mesh -I/mydir/libmesh/include/numerics -I/mydir/libmesh/include/parallel (and so on)
So I'd like to use this command in the .pro file instead of declaring every include path. The same for the --ldflags flag option that gives to me paths to libraries.
I've tried to write in the .pro file the following line, for example:
unix {
INCLUDEPATH += `/mydir/libmesh-config --include`
}
but it does not work (I get a "argument:: No such file or directory" error in qtcreator).
I'd like to know if it's possible to use this command to include libraries, instead of doing it by hand.
Thanks in advance.