[DOC] Configuring Qt Creator as SDK for uClinux by email@example.com
Hi, I have learned about how to configure Qt Creator as SDK for uClinux. Qt Creator is much more easier to compile and debug than using eclipse for uClinux programs. I discovered this method from threads and helps from this forum. I am posting this guide and hoping it can help others. The guide is lengthy but saves a lot of time after you successfully configured it. This guide for Linux OS only.
These are the links that helped me:
The guide starts in next post.
RE: [DOC] Configuring Qt Creator as SDK for uClinux by firstname.lastname@example.org:
Before starting, you need to know the meaning of "Qt for Embedded for Linux" and "qmake".
Have blackfin toolchain installed.
Have Qt Creator installed.
Have uClinux distribution compiled. ( I am using uClinux 2011RC3 this guide)
BACKUP UBUNTU/LINUX! The installation of qmake embedded may overwrite the current qmake on the PC. Backup everything in case of something goes wrong.
1. Open uClinux distribution folder and navigate to blackfin-linux-dist/lib/qt-embedded/qt-embedded-linux-opensource-src-4.5.1/.
2. Back up Makefile. Simply copy and rename it as Makefile.bak
3. Open Makefile. The STAGEDIR stores the installation path of Qt embedded. Therefore replace all “STAGEDIR” by the word “CUSTOM”. Then add “CUSTOM= ” add the top line of the Makefile. This will change the installation path to Ubuntu root folder.
4. Before start installation, moc tool and uClinux libraries need to be included in the configuration. Navigate to blackfin-linux-dist/lib/qt-embedded/qt-embedded-linux-opensource-src-4.5.1/mkspecs/qws/linux-bfin-fdpic-g++. Back up qmake conf as qmake.conf.bak
5. Add the following text to qmake.conf. Remember to replace the path to meet where you compiled uClinux distribution:
QMAKE_INCDIR_QT = \ /home/uclinux/Documents/blackfin-linux-dist/lib/qt-embedded/build-qt-embedded-linux-opensource-src-4.5.1/include/QtCore \ /home/uclinux/Documents/blackfin-linux-dist/lib/qt-embedded/build-qt-embedded-linux-opensource-src-4.5.1/include/QtNetwork \ /home/uclinux/Documents/blackfin-linux-dist/lib/qt-embedded/build-qt-embedded-linux-opensource-src-4.5.1/include/QtGui \ /home/uclinux/Documents/blackfin-linux-dist/lib/qt-embedded/build-qt-embedded-linux-opensource-src-4.5.1/include QMAKE_LIBDIR_QT = /home/uclinux/Documents/blackfin-linux-dist/lib/lib/qt-embedded/build-qt-embedded-linux-opensource-src-4.5.1/lib QMAKE_MOC = /home/uclinux/Documents/blackfin-linux-dist/lib/qt-embedded/build-qt-embedded-linux-opensource-src-4.5.1/bin/moc
(Replace the path above according to where you store uClinux distribution)
6. Re-compile uClinux distribution using the command “make lib/qt-embedded_only”. This will tell uClinux to compile and install qt embedded only.
7. Restore Makefile and qmake using the backup file made in step 5 and 6.
CONTINUE in next post
8. Open Qt Creator
9. In Option window, click “Build&Run” → “Tool Chains” → “Add” → “GCC”:
To select new tool chain, Change the “Compile path” to “/opt/uClinux/bfin-linux-uclibc/bin/bfin-linux-uclibc-g++”;
Change the “Debugger” to “/opt/uClinux/bfin-linux-uclibc/bin/bfin-linux-uclibc-gdb”.
10. In Option window, click “Build&Run” → “Qt Versions” → “Add”:
In “Add” dialog, navigate the path to /usr/bin. Choose “qmake” and then click “Open”.
Then rename “Version name” to “Qt Embedded for Blackfin”. Click “Apply”.
11.Open a Blackfin project. Click “Project” in the left panel. Under Build Setting, Add build configuration:
Make sure Qt embedded for Blackfin is selected for "Qt version" and BFIN toolchain is selected for "Tool chain".
After the above steps, Qt creator should be successfully configured for uClinux. When you doing program, you can run the program on PC first by using the default configuration, e.g. "Qt 4.8.1" in last picture. After everything is working properly, you can compile the codes using "Qt embedded for Blackfin" configuration for uClinux.
To add libraries or other gcc option, simple edit the Qt project file.