Building for multiple Linux targets
-
I'm new to Qt but am impressed with QT Creator. As our company develops mostly server apps, we target RedHat 5 & 6 primarily.
I'm just now discovering the limited support for RH5/6 (Qt Creator just won't install on either). Hoping someone can answer:
- Do developers commonly develop on one platform (eg: latest fedora/ubuntu) and the recompile without Qt creator on another platform?
- How do developers build for multiple platforms with QT? Run one VM for each platform?
- Is there a recommended way to check for QT version to add ifdef's ?
-
Hi,
IIRC, RH5/6 comes with older library so you have to compile Qt 5/ Qt Creator yourself. Apart from that, no problem with RedHat.
1 and 2:The general concept is to have your main platform as development environment and if you want to have your application running on different OS (platforms) one generally uses virtual machines and builds the software natively (Qt Creator is generally installed to build/test the application).
3: Yes, using Q_OS_MACX, Q_OS_LINUX, Q_OS_WIN and friends when using platform specific code or libraries. Unless I misunderstood your question
4: Deployment, each platform has it's own deployment system, you should have a look at the various deployment guides in Qt's documentation. Linux distribution is another beast and you should look at which distribution you want to support
Hope it helps
-
I tend to work with a fairly modern linux as a base and run my Qt Creator in there. My code is built in different chroot environments though (one for each platform I care about and for each project I work on). Those chroot environments contain minimal installations of the Linux distributions I am targeting with them. That I will notice new dependencies getting introduced into the projects.
I do my building via make/qmake wrappers that runs the command in the appropriate chroot environment. Using chroot I gain a lot of flexibility wrt. (Linux-) targets to support without compiles being noticeably slower than on the "real" OS platform. Plus I can save away the state of my environment for each project I work on (simply tarring up the directory containing the chroot is enough) and restore it later.