cmake Variables and Properties

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

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.

Syntax

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

Remarks

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

${variable_name}

and is evaluated inside a quoted argument

"${variable_name}/directory"


Got any cmake Question?