Howto:Get Local Copies of Flightgear Source Code

From FlightGear wiki
Revision as of 03:19, 6 September 2018 by Callahanp (talk | contribs) (Get Sources for FlightGear and related components)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Local copies of source code for each component that needs to be built for FlightGear can be downloaded with a single Git command each.

You can execute the git commands individually, or you can do it the easy way and use the download_and_compile.sh script to do it for you.

Git Repository Directories

I believe the same project directories can be used for multiple IDEs. I may be wrong, but we'll go with that assumption for now. The gotcha will be if a project has new files added in one ide and they're not picked up by the other one.

The approach I've taken is to use the download and compile script to get a copy of the next branch that I can just build with the script anytime I want. Taking things a step further, I've set up a development directory along side of the next directory with copies of the individual projects I'll be working on and links to the next directory for any that I won't be making changes to.

Use the download and compile script to do an initial get of the sources for plib, OSG, OpenRTI simgear, flightgear and fgdata. This will allow you to build the Main Flightgear executable.

cd ~/fg
mkdir -p ~/fg/next
cd ~/fg
wget -O download_and_compile.sh https://sourceforge.net/p/flightgear/fgmeta/ci/n
cd ~/fg/next
~/fg/download_and_compile.sh PLIB OSG OPENRTI SIMGEAR FGFS DATA

if you wish to add additional flightgear modules supported by the script, you can add any of these to the parameter list for the script: CMAKE FGRUN FGO FGX OPENRADAR ATCPIE TERRAGEAR TERRAGEARGUI

using the script, source code appears in folders beneath the ~/fg/next/ folder.

optional: move the fgdata directory so you do not have to download it again if you delete your install directory.
Be sure to recreate the symbolic link if delete the ~/fg/next/install directory for any reason.

if [ ! -e ~/fg/fgdata ] 
then
  mv ~/fg/next/install/flightgear/fgdata/ ~/fg/fgdata/
  ln -s ~/fg/fgdata ~/fg/next/install/flightgear/fgdata
fi

Git Commands for Downloading sources

You can use these commands if you prefer a hands on approach or if you are only going to build flightgear through an IDE.

cd to some directory, and run these commands:

git clone https://cmake.org/cmake.git
git clone https://git.code.sf.net/p/libplib/code
git clone https://git.code.sf.net/p/openrti/OpenRTI
git clone https://github.com/openscenegraph/osg.git
git clone https://git.code.sf.net/p/flightgear/simgear
git clone https://git.code.sf.net/p/flightgear/flightgear
git clone https://git.code.sf.net/p/flightgear/fgdata
git clone https://git.code.sf.net/p/flightgear/fgrun
git clone https://git.code.sf.net/p/atc-pie/code
git clone https://git.code.sf.net/p/flightgear/terragear
git clone https://git.code.sf.net/p/flightgear/fgscenery/terrageargui

You may need to re-do one or more git clone commands if one of the projects gets corrupted beyond repair. Or again, you could just let the script take care of you.

Flightgear components FGO and FGX different download and build procedures. Use the download_and_compile script if you need them.


cmake

At some point in it's history the flightgear project needed to work with a specific version of cmake. The version was not available in one or more Linux distributions. This appears to no longer be the case and cmake installed from most linux distributions will be sufficient. You don't have to build it. We include it here because the situation may happen again.