简体   繁体   English

cmake选项默认值,否则

[英]cmake option default value if else

I tried to do that, but it doesn't appear on the cmake gui, how have I got to do to change the default value of option depending of SO, and it appear in the cmake gui? 我尝试这样做,但是它没有出现在cmake gui中,我该怎么做才能根据SO更改option的默认值,它出现在cmake gui中?

if(UNIX)
  option(HASH "enable hash" ON)
else()
  option(HASH "enable hash" OFF)
endif()

除非您unsetmark_as_advanced HASH变量,否则它应该出现在CMake GUI中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM