Customizing Qt Creator 5.12.4

Install the custom Toolchain

Download and install the toolchain rpm

sudo alien ~/Downloads/<toolchain-name>.rpm

sudo dpkg -i ./<toolchain-name>.deb

Locate the arm compiler

sudo find / -iname arm-*-gnueabihf-g++ 2>/dev/null

/opt/toolchain/arm-cortexa9_neon-linux-gnueabihf-lh3/bin/arm-cortexa9_neon-linux-gnueabihf-g++

Settings

Go to the Projects Tab on the left pane.

BuildSettings

Click on the Manage Kit buttons.

ManageKits

If you want use your custom compiler and debugger etc then you have to create a manual kit.

A kit is a set of tools like compiler, QtVersion (qmake), debugger, device etc.

Before you can create a manual kit, you have to create place holders for your custom compiler, debugger etc.

Kit

image

Qt Version

Go tot the Qt Version Tab and select manual. Then click on Add button.

Here we are trying to specify the qmake binary we are going to use for the project.

In my case my qmake is located (comes from installation of the toolchain) at the below location:

/opt/toolchain/arm-cortexa9_neon-linux-gnueabihf-lh3/bin/qmake.

So in the add wizard I navigate to the above location and select qmake binary.

Qt automatically detects it as Qt Version 5.11.2. In the Kit section we are going to refer to this in near future.

Compilers

Next we have to choose our own custom C++ compiler.

In my case my C++11 compiler is located (comes from the toolchain installation) at the below location

/opt/toolchain/arm-cortexa9_neon-linux-gnueabihf-lh3/bin/arm-cortexa9_neon-linux-gnueabihf-g++.

Now, click on the Manual → C++ and click the Add button to start adding your own custom g++ compiler to the list.

This will ask you to provide a name to the custom compiler, give a name, e.g. “G++ for ATOM”, any other string you like.

Put the absolute path of the g++ binary which you want to add under the Compiler path:

/opt/toolchain/arm-cortexa9_neon-linux-gnueabihf-lh3/bin/arm-cortexa9_neon-linux-gnueabihf-g++

In the ABI, select arm-linux-generic-elf-32bit, leave the rest as default.

Apply, ok. Now you have your custom compiler in the list.

Debuggers

Go to the debugger tab.

Click on the Manual and Add.

Provide a suitable name, “ATOM GDB for Cortex A9”.

Specify the absolute path in the Path.

/opt/toolchain/arm-cortexa9_neon-linux-gnueabihf-lh3/bin/arm-cortexa9_neon-linux-gnueabihf-gdb

Apply, Ok.

Devices

In the Devices specify the details of the device where you want to run your generated binaries.

Custom Kit

Now go back to the Kits tab.

Select Manual.

Click on Add.

Provide a name for your custom Kit, e.g. ATOM.

In the Device Type, select Generic Linux Device.

In Device, select your own device, e.g. Custom Atom Device.

Compiler: C++: select your own created compiler from the drop down list.

Debugger: select the one you created previously.

Qt Version: select your own Qt Version as created previously.

Additional build arguments

Under Build & Run on the left hand panel, select the Build Option.

This will show you a loads of option on the right hand pane.

For our project we need to set the environment variable PRODUCT=ATOM.

To add this, click on the Details button along side qmake command under Build & Run.

This will look like below:

In the Additional Argument section specify, PRODUCT=ATOM.

Now, save it and try compiling your code. Make sure you clean it before giving it a try.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s