[CMake] What's the difference between option and variable of type bool

Bill Hoffman bill.hoffman at kitware.com
Wed Mar 11 09:55:16 EDT 2009


Marcel Loose wrote:
> Hi all,
> 
> I feel rather stupid, but I fail to see whether there's any difference
> between a CMake option (which is stored in the cache as a variable of
> type bool) and a CMake variable of type bool that's being cached.
> Both can be modified in a GUI like ccmake.
> 
> Is there any reason to prefer the former over the latter?
> 

There is no difference, option is a bit shorter to write, and maybe more 
descriptive.

-Bill


More information about the CMake mailing list