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

conditional-compilation, include, projects-and-solutions, qt, qt-creator

Solution

Have you tried this:

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

Problem

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?

Original source