Chapter 4.  Using CMake to Build and Install Geant4

In release 9.4, a new beta build system for Geant4 using the CMake build system is available. CMake has been chosen as an easy to use and maintain, cross-platform tool that addresses several shortcomings of the existing Configure/Make buildsystem. As a beta, not all of the UI and Visualization drivers available in Geant4 and supported by the current Configure/make build system are available. Also, only the following systems are currently supported in this beta version:

It is expected that the CMake generated buildscripts for Eclipse, KDevelop and Xcode will be functional, but have not been tested yet. Windows builds on XP using the MSVC++ compiler through CygWin have not yet been tested. Native Windows builds using Visual Studio are not yet fullyfunctional. We welcome feedback and problem reports, which should be logged on the Geant4 bug tracking system.

4.1.  Prerequisite Software

To use the CMake build system, the software listed in Section 1.2 and optionally the Qt4, OpenGL, DAWN and VRML packages listed in Section 1.3 should be installed on your system.

In addition, a recent CMake version, specifically one of

  • 2.6.4

  • 2.8.*

should be installed on your system. Binary packages for CMake of the required versions are generally available on most mainline Linux distributions, and should be preferred if available. Otherwise, source and binary packages for Linux, MacOSX and Windows are available from the Kitware download page.