CMake files are used to generate make files which automate the compilation and building process by running the suitable compilers and linkers.
Why do we need it ?
A reliable software depends on other libraries and software as well, so there was a need for another “software” or “tool” that organize and order the compilation, linking and building process.
Can we work without it ?
Yes, If the project is simple and small, we can use a simple text file written with a simple text editor like notepad, and pass it to a simple compilation and building commands within a terminal to get our target, an exe file or a library.
I am not familiar with it ! Why ?
Because you used to use the IDE “Integrated Development Environments” like visual studio and QT which in most of cases makes all the tasks instead of you, it offers you a text editor , an autocomplete feature, a compiler, a linker a debugger, etc.. and that is why it is “Integrated” development Environment
How do we write such file ?
Not all of your source codes are intended to be an executable, some will be a dynamic library, another could be a static and so on. You tell this file where is your header and source files, and which file will be an exe and which will be a library “if needed” and which external libraries you will link to your exe “target”
Finally you pass this file to the CMake program/command which in turn generates a make file. The make file is then passed to the make command/software to make your targets ready :)
Good Luck :)