Silicomancer
Silicomancer

Reputation: 9156

Add an include to each module of a Qt project

Is there a portable way to add certain include(s) to all C++ modules that are part of a Qt project by modifying the .pro file (like I would do it for GCC using the -include option)?

Upvotes: 0

Views: 106

Answers (1)

Matt
Matt

Reputation: 15091

There's no portable way to do this, as every compiler should be treated differently.

The best you can do is to write a bunch of conditionals. For example

*-g++:QMAKE_CXXFLAGS += -include myheader.h
else:*-msvc:QMAKE_CXXFLAGS += -Fi myheader.h
# else:...

Upvotes: 1

Related Questions