cmd2.0

@cmd2

Joined 09 May 2022

alt

3 following 1 follower


Articles



CMake Tutorial
Published 09 May 2022

CMake is a cross-platform, open-source build system generator. The following tutorial is inspired by modern-cmake by Henry Schreiner

v82pxakdjj5uy13hp0qi.pngHow to Run


## Conventional Run
~/package $ mkdir build
~/package $ cd build
~/package/build $ cmake ..
~/package/build $ make

## Single Line CMake build
~/package/ $ cmake -S project -B build -G "MinGW Makefiles"
~/package/ $ make -C build
~/package/ $ build\MyExample


Once cmake build has been called, we can edit files and directly run them using


~/package/ $ make -C build && build\MyExample


Tutorial

##### ------------------- BASICS ------------------- #####

cmake_minimum_required(VERSION 3.12...
128 views