How it works

The option command accepts three arguments:

 option(<option_variable> "help string" [initial value])
  • <option_variable> is the name of variable representing the option.
  • "help string" is a string documenting the option. This documentation becomes visible in terminal-based or graphical user interfaces for CMake.
  • [initial value] is the default value for the option, either ON or OFF.