![]() Even after having set up many kits, I still spend 1-2 hours for defining a kit. In the beginning, it was more like 4-6 hours. The integration of QtCreator, CMake and Yocto has been wanting for quite some time. I was curious, how Qt Commercial made the setup so easy and what we could use for Qt LGPLv3. The crucial part of the easy setup with Qt Commercial is the script configure-qtcreator.sh. As the script is available under GPLv3, we can use it like QtCreator or GCC. When we build an application against a Qt SDK, we must source a shell script like environment-setup-cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi We first quit QtCreator and then call the script: $ configure-qtcreator.sh -config \Ĭonfigured Qt Creator with new kit: RPi3-XXX For convenience, we copy the script to a directory contained in $PATH (e.g., $HOME/bin). To set environment variables like OECORE_TARGET_SYSROOT, OECORE_NATIVE_SYSROOT, OE_CMAKE_TOOLCHAIN_FILE, CXX and CXXFLAGS for cross-compilation. The value of the option -config is the file path to this environment setup script. The QtCreator configuration script sources the environment setup script and assigns the environment variables to their CMake counterparts. For example, it assigns OE_CMAKE_TOOLCHAIN_FILE to CMAKE_TOOLCHAIN_FILE and CXX to CMAKE_CXX_COMPILER. The value of the option -qtcreator points to the directory path, which contains the QtCreator installation. The configuration script needs to find the sdktool utility, which is located in /libexec/qtcreator/sdktool and which is completely undocumented. Sdktool creates an entry for each tab – Kits, Qt Versions, Compilers, Debuggers and CMake – on the dialog page Tools | Options | Kits. For example, sdktool generates the entry for the C++ compiler with this command: $.g++" \ Without the QtCreator configuration script, we would have to create these entries manually. Sdktool writes these entries to files like profiles.xml for the kit and toolchain.xml for the compilers. These files are located in /share/qtcreator/QtProject/qtcreator. Qt reads the XML configuration files and displays them in the auto-detected Kit RPi3-XXX on the dialog page Tools | Options | Kits. We select Generic Linux Device as the Device type and Pi3B as the Device. If we haven’t defined a device yet, we can still do it now. The section Setup: Device of my post Docker Builds from QtCreator describes how. Sysroot, C Compiler, C++ Compiler and Debugger have the values OECORE_TARGET_SYSROOT, CC, CXX and GDB, respectively, from the Yocto environment setup script. Qt mkspec is always devices/linux-oe-generic-g++ for Yocto builds. The Qt version is defined by the path to the QMake binary. ![]() Cmake install use environment variables license#.Cmake install use environment variables password#.Cmake install use environment variables code#.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |