How to make the Qt project file (.pro) platform dependent?

Mikael picture Mikael · Apr 26, 2013 · Viewed 8.7k times · Source

Is there a way to include different libraries depending on the operating system with Qt-Creator?

In other words, is there an equivalent for the following lines in the .pro file:

#ifdef Q_WS_WIN
include(C:/myProject/myLybrary/my-lib.pri)
#endif

#ifdef Q_WS_X11
include(/home/user/myProject/myLybrary/my-lib.pri)
#endif

I know that the character '#' identifies a comment in the .pro file. What's the alternative here?

Answer

thuga picture thuga · Apr 26, 2013

Have you tried this:

unix: include(/home/user/myProject/myLybrary/my-lib.pri)
win32: include(C:/myProject/myLybrary/my-lib.pri)