Enjoyable and\or fun way to explain cmake
cmake, allows you to define variables, these variables can be filled with strings.
These strings can be tools or files.
Additonally it allows for conditional compiling, setting version numbers and library injection.
I would have a look at: https://cmake.org/cmake-tutorial/

Now on how to explain:
Cmake utilizes a script language to make building projects much easier. It has a feature set that does specific things. Like requiring specific versions of files. 
How to make it "fun" I dont know. But you could split your class in groups that each  have to create a header cmake replacement script, with a specific variable name. And a program that does anything they like, but has to use the defines. For example DEBUG
Then each group has to create a list of substitutions, and they share the substitutions. While executing the diffrent substitutions, they have to determine why something breaks or works although it shouldnt. This can be used to examplify, how the header operations work, and also how wrong or malicous usage can wreak havoc in their project.