Build FlightGear with Eclipse IDE

From FlightGear wiki
Jump to navigation Jump to search
WIP.png Work in progress
This article or section will be worked on in the upcoming hours or days.
See history for the latest developments.
This article is a stub. You can help the wiki by expanding it.

Eclipse

Eclipse is a java based Integrated Development Environment (IDE).

The latest version of Eclipse supports both git and Cmake without using an add-in.

However configuring the build in such a way as to keep the Eclipse configuration out of the git clone is proving difficult.

Combining Cmake, git and QT in Eclipse seems quite difficult given the current state of CDT Documentation.

I haven't given up, but at the moment I am stymied. You are welcome to set me straight if you know what to do.

Eclipse Installation

Eclipse installation is a complex subject.

On Linux, I suggest you simply install exclipse from your linux distribution's standard repository.

On Ubuntu

sudo apt-get install eclipse

Eclipse installation considerations

  • User Workspace Directory
  • User Installation of Features
  • System Wide Installation
  • System Wide Installation of additional features
  • User Reconfiguration to access the additional system-wide features

If you choose to use the Eclipse Installer instead, there is a dependency:

To run eclipse you must install a Java Development Kit (JDK).

Installing a jdk

Operating System JDK installation
Ubuntu 18.10 apt-get install openjdk-11-jdk
Macos
BSD
Windows 10

Earlier versions of Eclipse may have a different approach to integrating git or CMake.


Creating Eclipse Projects for FlightGear

There are several steps to creating an Eclipse Project to build flightgear:

  1. Install Flightgear Dependencies
  2. Decide which Flightgear git repositories you will be changing and which you will use without changes.
  3. For any flightgear repository you will be changing: SourceForge Forks Create SourceForge Forks
  4. Decide if you need to build branches without including your changes
  5. Decide how to structure directories to contain git archives for flightgear. Generally you want them all in the same directory. But if you want to build next, and separately build next with your changes, you'll need to have two directories.
One with the unmodified git archives, and one with modifable git archives and links to any local git archives you don't need to change.

For Example:

├── dev
│   ├── build
│   ├── install
|        ├── flightgear
|            ├── fgdata -> /home/pac1/fg/fgdata   
│   ├── eclipse-workspace
│   ├── fgdata -> /home/pac1/fg/fgdata
│   ├── flightgear
│   ├── openscenegraph -> /home/pac1/fg/next/openscenegraph
│   ├── plib -> /home/pac1/fg/next/plib
│   └── simgear
├── next
│   ├── build
│   ├── flightgear
│   ├── install
|       ├── flightgear
|           ├── fgdata -> /home/pac1/fg/fgdata
│   ├── openscenegraph
│   ├── plib
│   └── simgear
|   fgdata 

You can use download_and_compile.sh to easily create a next directory with all the relevant git archives. You can then create a dev directory somewhere outside of next and copy or link the sub-directories from next.

I intend to work only in simgear and flightgear, so those are copies. The others, including fgdata are symlinks.

Development of this page is stalled on integrating qt, cmake and eclipse. The following link is promising:

qt-development-on-linux-using-eclipse

Creating Forks of Flightgear's Sourceforge Git Repositories

We'll need to create an Eclipse Workspace. This will contain all the Flightgear components we need as separate Eclipse Workpace Projects. We'd like to keep the Eclipse workspace and workspace project files, which contain information specific to our local directory structure, separate from the Flightgear git directories.

This is not easy.

= Downloading clones of Flightgear's SourceForge Git Repositiories and Forks

Installing Flighgear Dependencies

Howto:Install FlightGear Library Dependencies

CMake and Eclipse

Configuring Eclipse to use SourceForge Git Repositories

Attaching Local Source Code for each project

It is at this point that I started to run into configuration difficulty. Combining Cmake, git and QT in Eclipse seems quite difficult given the current state of CDT Documentation.

I haven't given up, but at the moment I am stymied. You are welcome to set me straight if you know what to do.

Callahanp (talk) 21:40, 9 September 2018 (EDT)

Building

Build Directory

Install Directory

Running Flightgear

Setting up Run Configurations

Command and Parameters

Debug

Release