Skip to content
AgileLogics
4 min read

Build Tools: CMake for C++

Prerequisites: const correctness

As in C, CMake is the dominant cross-platform build tool for real C++ projects — this time also managing external library dependencies:

cmake_minimum_required(VERSION 3.20)
project(MyApp CXX)
set(CMAKE_CXX_STANDARD 20)

add_executable(myapp main.cpp)
mkdir build && cd build
cmake ..
cmake --build .

Larger projects typically pull in a package manager on top of CMake — vcpkg or Conan — to fetch and build third-party libraries, rather than vendoring their source directly.