简体   繁体   中英

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?

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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