Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a possibility to pass includes via -isystem when using qmake

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.

like image 503
Martin Avatar asked Nov 16 '10 22:11

Martin


People also ask

What does run qmake do?

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.

What is the difference between qmake and CMake?

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.

Is qmake deprecated?

Using qmake is still supported, but CMake has become an industry standard, offers a number of advantages, and is recommended for new Qt projects.

How use qmake and make?

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.


1 Answers

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
like image 62
Martin Avatar answered Sep 22 '22 03:09

Martin