Now we need a build system. Linux distributions and MinGW come with a make program (the MinGW provided one is named mingw32-make, though, since many users prefer to install a different make). Make is fantastically useful for automating build processes, but writing makefiles can be a real pain in the rear. That’s where CMake comes in.
CMake is like a make system for building makefiles. To use it you create a file called CMakeLists.txt using a very simple and easy to understand syntax to list where your source files are, where your libraries or dlls are, and how you want your program built. Then when you run cmake it creates the makefiles for you. CMake is cross platform itself, and it has lot’s of built in utilities for finding out where the libraries and dlls are on your system. It’s quite powerful, and I will be showing you a basic CMakeLists.txt file later on that provides a generic build system for simple games. If you follow the same file layout in your projects as mine then all you will have to do is edit the name of the program in the CMakeLists.txt file and everything will be handled automatically.
From the command line as root, run
$ yum install cmake
From the command line, run
$ sudo apt-get install cmake cmake-curses-gui
Download and run the installer program from the CMake website. When you run the installer, be sure to select the option to add CMake to your path so that it will be available from the command line.