Building using CMake: Difference between revisions

Jump to navigation Jump to search
m
Line 117: Line 117:
described above will work, but specifying an INSTALL_PREFIX or PREFIX_PATH is
described above will work, but specifying an INSTALL_PREFIX or PREFIX_PATH is
usually simpler.
usually simpler.
== Debug Builds ==


By default, we select a release build. To create a debug build, use
By default, we select a release build. To create a debug build, use
Line 124: Line 126:
(or MinSizeRel, or RelWithDbg)
(or MinSizeRel, or RelWithDbg)


Debug builds will automatically use corresponding debug builds of required
Debug builds will automatically use corresponding debug builds of required libraries, if they are available. For example you can install debug builds of
libraries, if they are available. For example you can install debug builds of
SimGear and OpenSceneGraph, and a debug FlightGear build will use them.
SimGear and OpenSceneGraph, and a debug FlightGear build will use them.


(Debug builds of libraries have the 'd' suffix by default - Release builds
(Debug builds of libraries have the 'd' suffix by default - Release builds have no additional suffix)
have no additional suffix)


'''Important: You should keep in mind that debug builds are usually not optimized at all. Thus, it is very likely that a debug binary will perform worse (framerate/performance-wise) than a release build. Many people have reported getting just frame rates of about 30 fps when using a debug binary!'''
'''Important: You should keep in mind that debug builds are usually not optimized at all. Thus, it is very likely that a debug binary will perform worse (framerate/performance-wise) than a release build. Many people have reported getting just frame rates of about 30 fps when using a debug binary!'''


Note most IDE projects (eg Xcode and Visual Studio) support building all the
Note most IDE projects (eg Xcode and Visual Studio) support building all the build types from the same project, so you can omit the CMAKE_BUILD_TYPE option when running cmake, and simply pick the build configuration as normal in the IDE.
build types from the same project, so you can omit the CMAKE_BUILD_TYPE option
when running cmake, and simply pick the build configuration as normal in the
IDE.


It's common to have several build directories with different build
== Multiple build directories ==
configurations (see [http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg39400.html] for more info), eg
 
It's common to have several build directories with different build configurations (see [http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg39400.html] for more info), eg


     /home/curt/projects/flightgear (the git clone)
     /home/curt/projects/flightgear (the git clone)
Line 145: Line 143:
     /home/curt/projects/fgrelease
     /home/curt/projects/fgrelease
     /home/curt/projects/fg-with-svn-osg
     /home/curt/projects/fg-with-svn-osg
== Optional Features ==


To set an optional feature, do
To set an optional feature, do

Navigation menu