CCmake available variables

cmake, configuration

Solution

If you add the `CACHE` part to your `set` command, it will be visible in CCMake. So, e.g.

set(VAR <value> CACHE PATH "Some details about VAR")

The types of variable which appear in CCMake are `FILEPATH`, `PATH`, `STRING` and `BOOL`.

For full details, run:

cmake --help-command set

Problem

I want to set configuration variable (path, in particular) in CMakeList.txt for my project, which user can override in CCmake. But if i just use `set(VAR <value>)` `VAR` is not available for changing in CCMAKE, how can i do that?

Original source