Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Advantages of using CMake option command rather than set?

Tags:

cmake

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?

like image 369
Samuel Avatar asked Jun 28 '12 02:06

Samuel


Video Answer


1 Answers

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.

like image 101
Fraser Avatar answered Nov 08 '22 19:11

Fraser