

in a top level build directoryĭon't run cmake directly in your src tree. The figure above should help reduce confusion. Additionally it can be confusing to know where to run make or cmake. The primary disadvantage of using a separate build directory is that it can sometimes get confusing if we are in the build tree or the source tree.

Automatically built files are separated from the source tree.gitignore file in the source tree is usually set to ignore the entire build directory. Since these files can be automatically generated from the green source tree, there is no need to include them in git. The contents of these subfolders are generated automatically by cmake, make and the compiler, using the CMakeLists.txt files in the green source tree as instructions. Let's focus on the one on the right labeled cmake build. Separate from the green folders are the build directories. Each folder in this green subtree will usually have an accompanying CMakeLists.txt file which describes what files to compile and what executables to build. ui files, and all the files managed by git in this folder. It is the contents of your creative efforts.
#CMAKE LINUX BUILD CODE#
The green subdirectory above contains all source code you write. Having a separate build directory might be new to some, so here is a short explanation using the figure below for a project in the examples folder
