Cross-platform, single .pro file in QT Creator?
Similar question to [1]
I've developed (halfway through) an app in Linux which will also need to be deployed in Windows. I have a Windows VM, and am currently struggling through the compilation of opencv (which I use in my app). Any modifications I can make to my .pro file so that i don't need to maintain two copies of it, one for each OS?
[1] - http://qt-project.org/forums/viewthread/31873
Re: Cross-platform, single .pro file in QT Creator?
qmake was specifically designed to use the same .pro file across platforms.
The thread you link to is about a different question, about running two instances of QtCreator in parallel on the same files but with different configurations.
Cheers,
_
Re: Cross-platform, single .pro file in QT Creator?
But things like setting LIBS etc. - aren't the paths different on Windows than on Linux (where everything is /usr/lib)? Because the guides I see to using opencv, for example, involve hard-coding the Windows path in the .pro file.
Re: Cross-platform, single .pro file in QT Creator?
Ah.
You can make conditional sections.
Conditions can be test functions, platforms, compilers, etc.
For example
Code:
win32 {
LIBS += ...
}
triggers for Windows, any compiler, and
triggers for Windows, Microsoft's compiler only, while
triggers for GCC, any version, any platform, and so on.
Cheers,
_
Re: Cross-platform, single .pro file in QT Creator?
Thanks! That solves it =)