Really simple CMake demo using FetchContent
If you have a recent version of CMake (3.15 or better) under linux, macOS or freeBSD, you can simply go in the directory and type the following commands:
cmake -B build .
cmake --build build
./build/repro
The instructions with Visual Studio (Windows) are similar:
cmake -B build .
cmake --build build --config Release
./build/Release/repro.exe
- On macOS, the easiest way to install cmake might be to use brew and then type
brew install cmake
- Under Linux, you might be able to install CMake as follows:
apt-get update -qq
apt-get install -y cmake
- On FreeBSD, you might be able to install bash and CMake as follows:
pkg update -f
pkg install bash
pkg install cmake
- Under Windows, you may want to install CMake using an installer.