Using CMake via a command-line interface
Although CMake is quite well integrated into many IDEs and editors, it is essentially a command-line tool, so learning how to use CMake in the command-line interface (CLI) is essential to use it to its full potential. Using CMake through the command line also helps to understand the inner workings and concepts of CMake. In this section, we are going to learn how to perform the most basic CMake operations using the CLI.
Interactions with the CMake CLI can be done by issuing the cmake
command in your operating system’s terminal, assuming that CMake is installed and the cmake
executable is included in your system’s PATH
variable (or equivalent). You can verify that by issuing cmake
in your terminal without any parameters, as shown in the following figure:
Figure 2.1 – Invoking the cmake command
If your terminal is complaining about a missing command, then you should either install CMake (explained...