Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

How to use QT Creator IDE for OpenGEE

tst-basilhuffman edited this page Nov 1, 2017 · 3 revisions

Introduction

This document outlines the steps needed to setup QT creator as an integrated development environment (IDE) to build, debug, and maintain OpenGEE source code.

It should be noted that this is purely for purposes of setting up an IDE, as current versions of QT creator do not support QT 3.

Prerequisites

Setting Up Build Configurations

After starting QT creator, create a new project via New Project → Import Project → Import Existing Project

Click on Choose.... Choose a project name (e.g. EarthEnterprise) and then select the earth_enterprise folder (which contains most of the source code), then click Next.

Select the src folder

Click Next then don't add the project to any version control.

Click Finish. This will create 4 files:

  1. .config
  2. .creator
  3. .files
  4. .includes

These files are QT-specific and pertain to the configuration of the project.

Setup Debug Build Configuration

On the left panel, click on Projects, then click the Add dropdown box, and then Build. For ease of use, this build can be called Debug. Click ok.

Under Build Steps, click Add Build Step → Custom Build Step. Here, custom build steps will be created which will build OpenGEE binaries, run unit tests, and build the installers. For reference about those steps see GitHub OpenGEE build and installers references.

In the Command box, put the path to scons (e.g. /usr/bin/scons)

In the Arguments box, put -j4 internal=1 build

Then, click Add Build Step → Custom Process Step to create the build step that runs the unit tests and then add another to create the installers.

In the Command box, put the path to perl (e.g. /usr/bin/perl)

In the Arguments box, put RunAllTests.pl

In the Working Directory, put %{buildDir}/src/NATIVE-DBG-x86_64/bin/tests.

Finally, create one additional step for doing a stage install, in the same manner as before.

In the Command box, put the same path to scons.

In the Argument box, put j4 internal=1 stage_install.

Note: to avoid the error No rule to Make target 'all'. Stop., make sure that the Make: make all build step is disabled (it is created by default). This is done by clicking on the circle with the line through it or by simply deleting the step altogether.

An optional step is to create a Clean Custom Process Step using the Command /usr/bin/scons and the Arguments -j4 -c internal=1 build. Also, you may delete the NATIVE-DBG-x86_64 folder to make absolutely certain that no files are left behind from a previous build. This is done by running the following command from the terminal: _rm -rf earth_enterprise/src/NATIVE-DBG-x86_64.

Once done with creating all appropriate steps, perform a build. This is done by Ctrl-B or Build → Build Project . If all the prerequisites are present, the build process should start, unit tests executed, and then installers built.

Note: Sometimes, the unit test build step can fail but succeed when re-run

Debugging and Stepping Into Code

First run the installers to install ‘Fusion’ and ‘Server’, then make sure to start the needed services:

$ sudo service gefusion start $ sudo service geserver start

To start an application using QT Creator and debug it directly, add that application to the project as follow. For example to start and debug ‘Fusion’:

On left panel click Projects, then click Run and add the parameters for your app to debug.

Once this done, go back to QT Creator menu, then Debug → Start Debugging (or F5). This would build OpenGEE and start ‘Fusion’ in debug mode. Debug breakpoints can be inserted into the code to break the execution at the appropriate code lines.

Note: Running the app via pressing F5 causes the build to be refreshed and the tests to be run, and can be avoided by using the 'Start Debugging without deployment' option.

Alternatively you can start any app outside from the IDE (fusion, server, any of the tools) and go back to the IDE Debug → Attach to running application.

Setup Release Build Configuration

Click Add → Clone Selected to clone the debug configuration. Call the new configuration Release.

The same values can be kept as in the Debug configuration with the following exceptions:

  • in the scons commands, internal=1 should be changed to release=1
  • any step referencing the NATIVE-DBG-x86_64 folder, should be switched to reference the NATIVE-REL-x86_64 folder