~~NOCACHE~~ ~~NOTOC~~ WORK IN PROGRESS \\ \\ ===== Setup Qt Creator with Yocto build environment ===== ====Prerequisites==== * BSP built according to [[en:arm:tqma8xx:linux:yocto:quickstart_yocto| quickstart guide]], but instead of ''bitbake tq-image-weston'' you have to use ''bitbake tq-image-qt5'' * Build Yocto SDK based on the current RootFS configuration, installed on the development host. See [[en:arm:tqma8xx:linux:yocto:development_host#build_yocto_sdk|Build Yocto SDK]] how to build it * Configured SSH login on target. See [[en:arm:tqma8xx:linux:yocto:target#setup_ssh_connection|setup ssh connection]] * Configured Network connection to the development host ==== Additional Yocto Packages ==== The following has to be added to the local.conf file in the build directory or to your custom image recipe: IMAGE_INSTALL_append = " openssh-sftp-server" ==== Setup Development Host ==== === Set Up Qt Creator === Download the Qt installer from the following link, in this case Qt 5.13.2: \\ [[https://download.qt.io/archive/qt/5.13/5.13.2/qt-opensource-linux-x64-5.13.2.run]] \\ \\ Afterwards make the Qt installer file executable and run the Qt installer. Follow the installation wizard instructions.\\ The next step is to add the environment setup of the Yocto SDK to the first line (above the shebang) of the file qtcreator.sh script.\\ If the install location has not been changed the qtcreator.sh is located in **~/Qt5.13.2/Tools/QtCreator/bin/qtcreator.sh** source /opt/fsl-imx-wayland/5.4-zeus/environment-setup-aarch64-poky-linux === Run Qt Creator === change to the directory where the qtcreator.sh file is located and execute the following command: sudo sh qtcreator.sh If qtcreator.sh returns source: not found, before sudo sh qtcreator.sh, enter sudo dpkg-reconfigure dash and choose no. === Configure Qt creator === == Setup SSH connection == - Go to **Tools > Options > Devices > click Devices** - Click **Add > Generic Linux Device > Start Wizard** - Change the name to "STKa8Xx" and set up the connection. {{:en:arm:tqma8xx:linux:yocto:yocto_qt_ssh.png?nolink&800|}} == Add compiler == - Go to **Tools > Options > Kits > click Compilers** - Click **Add** and select **GCC > C** - Change Name to **TQMa8Xx** - Set **Compiler path** to /opt/fsl-imx-wayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++ - Set the following values for **ABI** from the dropdown menus: ^ processor architecture ^ operating system ^ OS flavor ^ binary format ^ system architecture ^ | arm | linux | generic | elf | 64bit | - Click **Add** and select **GCC > C++** - Change Name to **TQMa8Xx** - Set **Compiler path** to /opt/fsl-imx-wayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++ - Set the following values for **ABI** from the dropdown menus: ^ processor architecture ^ operating system ^ OS flavor ^ binary format ^ system architecture ^ | arm | linux | generic | elf | 64bit | {{:en:arm:tqma8xx:linux:yocto:yocto_qt_compiler.png?nolink&800|}} == Add new Cross Compiled Qt Version == - Click **Qt Versions** on the **Kits** panel - Click **Add** - Locate the qmake file in /opt/fsl-imx-wayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/qmake If the qmake file has been auto-detected by Qt Creator qmake has not to be added manually. {{:en:arm:tqma8xx:linux:yocto:yocto_qt_qmake.png?nolink&800|}} == Add new Kit == - Click on **Kits** in the **Kits** panel - Click **Add** and set the following: **Name** STKa8Xx\\ **Device Type** Generic Linux Device\\ **Device** STKaXx (default for Generic Linux)\\ **Sysroot** /opt/fsl-imx-wayland/5.4-zeus/sysroots/aarch64-poky-linux\\ **Compiler** C: TQMa8Xx C++: TQMa8Xx\\ **Qt version** Qt 5.13.2 (System)\\ {{:en:arm:tqma8xx:linux:yocto:yocto_qt_kit.png?nolink&800|}} == Run Example == * Go to **Welcome > Examples > click Qt 5.13.2 GCC 64 Bit** * Search for Digital Clock Example * On **Configure Project** selct the **STKa8Xx** and click **Configure Project** * Click on Build (CTRL + B) and afterwards on Run (CTRL + R) {{:en:arm:tqma8xx:linux:yocto:yocto_example.png?nolink&800|}} {{:en:arm:tqma8xx:linux:yocto:yocto_example_run.png?nolink&800|}} ==== Build Yocto SDK ==== Building the toolchain requires a Yocto build environment configured for meta-tq or ci-meta-tq The setup of the build environment is described on the corresponding Yocto quickstart of the module. The meta-qt5 Yocto layer has to be added to the Yocto build environment when using meta-tq After the Yocto build environment the SDK can be built by the following command: bitbake meta-toolchain-qt5 \\ Building meta-toolchain-qt5 may take several hours, depending on your hardware configuration ==== Installing Yocto SDK ==== After building meta-toolchain-qt5 the SDK file is located in the following path of the build directory **tmp/deploy/sdk/fsl-imx-wayland-glibc-x86_64-meta-toolchain-qt5-aarch64-toolchain-5.4-zeus.sh** Execute the *sh file to install the SDK, the default path is set to **/opt/fsl-imx-wayland/5.4-zeus**