I use qmake as a makefile builder and want to stick to it. Further I would like to use "gcc -Wall -Werror -Wundef -Wextra" to get robust code. I'm thinking about "-pedantic" but that's further up the road. My main problem at the moment are the tons of warnings generated by libraries like boost, parts of qt and the like.
At the moment I use pragmas whenever I include warning-generating headers
#pragma GCC diagnostic ignored "-Wall"
#include <QtGui>
...
#include <QWidget>
#pragma GCC diagnostic error "-Wall"
This is far from cute, rather tedious and cumbersome especially as other programmers have to do so too. Is there an option using qmake that allows to include qt-libraries as system headers, thus supressing their warnings. For plain makefiles and cmake I knwow -isystem but I cannot find a qmake pendant for this.
The qmake tool helps simplify the build process for development projects across different platforms. It automates the generation of Makefiles so that only a few lines of information are needed to create each Makefile. You can use qmake for any software project, whether it is written with Qt or not.
Both are build systems, but they're not very similar at all. If your project uses Qt, you're probably best off using qmake. CMake is more generic, and fits pretty much any type of project. Both qmake and CMake generate a Makefile, which is read by make to build the project.
Using qmake is still supported, but CMake has become an industry standard, offers a number of advantages, and is recommended for new Qt projects.
For simple projects, you only need to run qmake in the top level directory of your project. By default, qmake generates a Makefile that you then use to build the project, and you can then run your platform's make tool to build the project. qmake can also be used to generate project files.
Easiest way I found is including directly via QMAKE_CXXFLAGS e.g. for Boost this looks like the following in the project file
QMAKE_CXXFLAGS += -isystem /usr/local/boost_1_44_0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With