Chapter 2. Compilation and Installation of OpenSceneGraph

It is usually a painstaking process to create binary files completely from the source code in order to construct an efficient development environment. There are two different ways to set up the OSG working environment: for beginners, an easy-to-use prebuilt package installer can be obtained from the official OSG website, which may help with installing particular versions of OSG (not all versions have a corresponding installer); and for developers with more experience, there is a more flexible way to work with the OSG source code—using the CMake build system, which is also presented in detail.

In this chapter, we will tell you:

  • How to obtain OSG prebuilt packages with the quick installer
  • How to make use of application utilities provided by the installed OSG distribution
  • How to get familiar with the CMake build system and how to set compilation options properly
  • How to build OSG and set up a working environment from the source code on Windows and UNIX platforms
  • How to configure development environment variables