CMake

  • Manages the build process in an operating system and in a compiler-independent manner
    1. Preprocessing
    2. Compiling (HL code machine level (“object”) code)
    3. Linking (object code executable)
  • cmake DIR is a Makefile generator
    • A Makefile is generated in the CURRENT directory following instructions given by a CMakeLists file DIR/MakeLists.txt
  • make to execute the created Makefile
  • CMakeLists.txt files can reference other CMakeLists.txt files in sub-directories, so you are usually only interested by the CMakeLists.txt of the top directory

Makefile

  • Idea: make process of compiling programs with many source code files easier
  • Example: simple program w/ only a few src files can be compiled w/ g++
    • g++ main.cpp file1.cpp file2.cpp -o hello (compiles into binary hello)
    • For more source files this gets tedious