# CMake **CMake** is a build system generator. It reads a project description in `CMakeLists.txt` and generates native build files (Makefiles, Ninja, Visual Studio projects, etc.) for your platform. This solves portability—describe targets and dependencies abstractly, and CMake generates platform-specific build recipes. CMake is the de facto standard in HPC, embedded, and scientific computing. Most numerical libraries (Eigen, OpenCV, CUDA, MPI) ship with `CMakeLists.txt` and expect to be consumed via `find_package`. Knowing CMake is about reading and extending others' build scripts, not writing elaborate ones from scratch. ```bash $ mkdir build && cd build # out-of-source build $ cmake .. # generate build system $ cmake --build . # invoke generator (make, ninja, ...) $ cmake --build . --target test # run tests ``` CMake separates configuration (reading `CMakeLists.txt`, finding libraries) from building. The configuration step generates build files; the build step invokes the underlying tool. This two-step process lets you use the same CMakeLists.txt with different generators. ## Concepts 1. [[cmake-basics|Basics]] 2. [[cmake-cmakelists-txt|CMakeLists.txt]] 3. [[cmake-projects-and-targets|Projects and targets]] 4. [[cmake-executables-and-libraries|Executables and libraries]] 5. [[cmake-variables|Variables]] 6. [[cmake-conditionals-and-loops|Conditionals and loops]] 7. [[cmake-functions-and-macros|Functions and macros]] 8. [[cmake-finding-dependencies|Finding dependencies]] 9. [[cmake-linking|Linking]] 10. [[cmake-installation|Installation]] 11. [[cmake-testing|Testing]] 12. [[cmake-generators|Generators]] 13. [[cmake-modern-practices|Modern practices]] 14. [[cmake-subdirectories|Subdirectories]]