Out-of-source build trees

A source tree means a directory tree of source code files, where the root folder contains a top level CMakeLists.txt file.

A build tree means a directory tree of generated files. An out-of-source build tree means a build tree which doesn't appear under the source tree.

See generate a project build system.

When using CMake it is recommended that out-of-source build trees be used. One advantage is that one can start a fresh build by deleting the build tree or creating a separate build tree.

Note that build trees cannot be copied or moved because full paths are used in CMake.

A build configuration is determined by:

A separate build tree should be used for each build configuration.