How can I cross-compile my application on Qt. As for each project
I need two version
1). Which runs on computer on Qvfb & i386 Architecture
2). Which runs on device with Linux Framebuffer & ARM Architecture
I have already compiled Qt for device as well as for Qvfb. I am able to run examples on both platforms, But How can I cross-compile my applications. I would prefer that both output stays in different directories, that means output of i386 stays in output-i386 platform and output of ARM stays in output-ARM directory.
I am using Qt 4.6 for Embedded Linux.
Finally, the Qt Creator IDE provides a cross-platform, complete integrated development environment (IDE) for application developers to create applications for multiple desktop, embedded, and mobile device platforms, such as Android and iOS. It is available for Linux, mac OS, and Windows operating systems.
MinGW is distributed together with Qt Creator and Qt for Windows. MSVC (Microsoft Visual C++ Compiler) is a C++ compiler that is installed with Microsoft Visual Studio. Nim is the Nim Compiler for Windows, Linux, and macOS. QCC is the interface for compiling C++ applications for QNX.
You can simply set DESTDIR
in your .pro
file. See the qmake variable reference. You might also want to adjust the variables OBJECTS_DIR
, UI_DIR
, MOC_DIR
and RCC_DIR
.
The end of this article shows you how to change qmake in a working directory (you need to
run make destclean
first). This other article outlines the basic Qt for embedded Linux environment, just to give you the big picture.
Qt takes all platform specific details from mkspec file.
Specify mkspec file to qmake to cross compile by using -spec command line argument of qmake.
in mkspec file there are many defines by which you can customize compiling for different platforms like I can use DESTDIR to send final output file to particular directory, OBJECTS_DIR to send Objects file to particular directory. MOC_DIR to send moc generated files to particular dir, UI_DIR to uic generated headers and cpp files to particluar directory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With