I think the option
command is redundant because it can be replaced by the set
command. What are the benefits I could get when I use the option
command?
Asked
Active
Viewed 7,829 times
1 Answers
14
A variable defined in an option
command appears as a boolean choice in the CMake GUI or when running CMake interactively using cmake -i
. This is not the case for a variable defined using set
unless CACHE
is used and the type is not INTERNAL
.
Also, the CMakeDependentOption
module allows for specifying dependencies between options.

Fraser
- 74,704
- 20
- 238
- 215
-
3And `option` vs `set CACHE`? – Ciro Santilli OurBigBook.com Mar 21 '17 at 08:49
-
2@CiroSantilli709大抓捕六四事件法轮功 check [this](http://stackoverflow.com/questions/36358217/cmake-option-vs-set-a-cached-bool-variable) – Paolo M May 09 '17 at 08:17