Miscellaneous commands
Every language includes utility commands useful for various tasks, and CMake is no exception. It offers tools for arithmetic, bitwise operations, string manipulations, and list and file operations. Although the need for these commands has diminished due to enhancements and the development of numerous modules, they can still be essential in highly automated projects. Nowadays, you might find them more useful in CMake scripts invoked with cmake -P <filename>
.
Hence, this appendix, which is a summary of miscellaneous CMake commands and their various modes, acts as a convenient offline reference or a simplified version of the official documentation. For more detailed information, you should consult the provided links.
This reference is valid for CMake 3.26.6.
In this Appendix, we’re going to cover the following main topics:
- The
string()
command - The
list()
command - The
file()
command - The
math()
command