Welcome to the FIRST-HEP CMake tutorial! The aim of this tutorial is to cover the basics of using CMake. This tutorial is based on the online book Modern CMake, with a focus on CMake 3.11+. This is almost what is called the “More Modern” era of CMake (which is 3.12+). We will cover the basics of making and building a project, and some details of design.
First taught at the 2019 USATLAS Computing Bootcamp at LBNL.
On your computer, you need to have:
cmake(Version 3.11 or newer). See the instructions here.
- A C++ compiler - system default is fine.
Note that the ATLAS docker container has all of these things already.
docker run --rm -it atlas/analysisbase:21.2.75 bash source release_setup.sh git clone https://github.com/henryiii/cmake_workshop.git cd cmake_workshop
A quick and minimal docker works too:
docker run --rm -it alpine apk add git g++ cmake make git clone https://github.com/henryiii/cmake_workshop.git cd cmake_workshop
This does not make a volume, so you will lose whatever you do in here when it exits - that’s probably a good thing mostly.