Building using CMake: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
Note that these instructions are somewhat outdated, the latest instructions can be found here: gitorious.org/fg/flightgear/blobs/next/README.cmake
Note that these instructions are somewhat outdated, the latest instructions can be found here: http://gitorious.org/fg/flightgear/blobs/next/README.cmake


CMake generates build files for a variety of systems - you can choose whichever one you prefer, but the examples below are the most likely to work.
CMake generates build files for a variety of systems - you can choose whichever one you prefer, but the examples below are the most likely to work.

Revision as of 14:20, 19 October 2011

Note that these instructions are somewhat outdated, the latest instructions can be found here: http://gitorious.org/fg/flightgear/blobs/next/README.cmake

CMake generates build files for a variety of systems - you can choose whichever one you prefer, but the examples below are the most likely to work.

Building inside the source directory is strongly discouraged - create a build directory next to your source directory, and run Cmake from inside the build dir.

CMAKE_INSTALL_PREFIX specifies the location the compiled code will be installed to, but also adds library and header search paths. If you configure OpenSceneGraph, SimGear and FlightGear with the same value of CMAKE_INSTALL_PREFIX, most things will work automatically.

CMake includes CTest - depending on your build system, there should be a way to run the tests. Eg 'make test' for Unix Makefiles.


If you'd like to use an integrated development environment, illustrated instructions for building FlightGear and its dependencies can be found in Howto:_Build_FlightGear_with_NetBeans_using_CMake, this should work on both, Windows and Linux systems (NetBeans being a cross-platform IDE).


Using the CMake GUI

If you prefer, on any platform, you can use the CMake GUI frontend to generate the build files, instead of the command-line 'cmake' tool. All the documentation here still applies.

Linux / Unix

Install Boost, libpng, OpenAL, ALUT, PLIB

- FIXME - list package names for Fedora, Debian, Ubuntu to avoid people installing from source when they don't really need to.

Default Cmake target is regular make. Do 'cmake, make, make install' for OpenSceneGraph, then SimGear, then FlightGear

set CMAKE_BUILD_TYPE = Debug or Release as desired.

FreeBSD, Solaris

Should work if OpenSceneGraph and ALUT are supported, but let us know.

Eclipse, Code:::Blocks

Untested, feedback welcome

Mac

(Install XCode)

Install Boost, PLIB from Macports, Install James' ALUT framework (any other dependencies required for OpenSceneGraph?)

Get OpenSceneGraph, configure it for Cocoa, make + make install

Depending on your system, you may want to specify CMAKE_OSX_ARCHITECTURES=i386, to only build 32-bit - this assumes you also installed the +universal variants of the MacPorts libraires above, i.e Boost and PLIB, or you will get link errors about undefined symbols for certain architectures.

Run cmake, make, make install from the command line (Terminal) as for other Unix.

XCode

Basically the same as above! Don't need to set CMAKE_BUILD_TYPE, can be done inside XCode

Windows

MSVC 2010

Get Fred's latest 3rd party zip for 2010

Set MSVC_3RDPARTY_ROOT to point to the location of the extracted zip

Mingw

Untested as far as we know - try it and report back!