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`
c++ -o test test.cpp `/mydir/libmesh-config --cxxflags --include --ldflags`
To copy to clipboard, switch view to plain text mode
I use backquotes to have libraries path and so on. for example if I write
/mydir/libmesh-config --include
/mydir/libmesh-config --include
To copy to clipboard, switch view to plain text mode
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)
-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)
To copy to clipboard, switch view to plain text mode
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`
}
unix {
INCLUDEPATH += `/mydir/libmesh-config --include`
}
To copy to clipboard, switch view to plain text mode
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.
Bookmarks