cmake Variables and Properties


The simplicity of basic CMake variables belies the complexity of the full variable syntax. This page documents the various variable cases, with examples, and points out the pitfalls to avoid.


  • set(variable_name value [CACHE type description [FORCE]])


Variable names are case-sensitive. Their values are of type string. The value of a variable is referenced via:


and is evaluated inside a quoted argument