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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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.