Building via the superbuild
A CMake super-build is a project which downloads, configures and builds other projects. Download can be from a web server, or via Git or SVN. Most normal CMake options apply - you can use different generators (Makefiles, VisualStudio, XCode) and pass in options.
Getting the source
In all cases, you should get the superbuild by doing a clean clone (from Git) of fgmeta, with the --recursive options. This tells Git to clone submodules, which we need since both flightgear and simgear are submodules of fgmeta. The source repository is: here Once the clone complete, checkout the 'next' branch of fgmeta; the superbuild is not supported on the release branches. Note that providing you cloned with '--recursive', git pull will also update submodules automatically; some documentation and pages may tell you to manually run 'git update submodules' but providing you do the initial clone with '--recursive' option, it should not be needed.
Note the superbuild does not include any data repository or base files - you should separately download these or clone fgdata, and pass the location to fgfs when running in your preferred way, eg via the --fg-root command line argument.
Superbuild on Windows
Using VisualStudio / msbuild:
- VisualStudio 2010 (for the moment, other variations such as 2012 need some work)
- CMake for Windows
We assume you have cloned fgmeta in C:\FGFS\fgmeta. All the example paths below work just fine if you replace C:\FGFS with G:\MyAwesomeDir\AnySubDir. (Spaces in the paths are untested and might cause issues, but might work fine)
The steps are as follows:
- Make a build dir beside fgmeta - for example C:\FGFS\metabuild
- Run the CMake GUI, and select C:\FGFS\fgmeta as the source dir, and C:\FGFS\metabuild as the build dir
- Run 'Configure' once, and set CMAKE_INSTALL_PREFIX to C:\FGFS\metabuild\install (this step will be automated soon)
- Run 'Configure' again, and then 'Generate'
C:\FGFS\metabuild now contains a FlightGear-Meta solution (.sln);you can build this from a Visual Studio command prompt using msbuild, or open up the .sln in the IDE and again hit build. The first time will be slow - OpenSceneGraph and Boost will be downloaded and compiled, followed by all of simgear and finally flightgear.
Once the build completes, it is easier to run FlightGear by closing the -Meta solution, and instead opening the Flightgear.sln in C:\FGFS\metabuild\fgbuild. From here you can set 'fgfs' as the startup project, enter any command line options, and debug / hack / run the code as normal.
Note you will need to add the OpenSceneGraph install directory to the PATH variables in the 'fgfs' target properties; the dir will be something like C:\FGFS\metabuild\install\msvc100\OpenSceneGraph\bin. Again this step will hopefully go away soon, bu for the moment is still required.
Using other generators / IDEs: untested, but quite likely to work if they already work with CMake. Try it out.
Superbuild on Linux
- compiler (probably GCC)
- CMake - available on all distros
- Boost - available on all distros
- development packages for your distribution. (For OpenGL, OpenAL and OpenSceneGraph dependencies such as FreeType)
See here for some lists of packages names for distributions, but be aware these change or go out of date.
(The follow assumes regular 'make' generator, other generators may work, testing welcome)
- make build dir next to your fgmeta clone
- cd into the build dir
- run cmake ../fgmeta -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Release (or Debug for a debug configuration(
- run make -jN (where N is as large a number as your system can support)
- make some coffee
- fgfs should be in install/bin
Superbuild on Mac
Make-based build works, XCode is more interesting. Probably only for the brave,