1

I encountered CMake project where cache entry in cmake-gui was presented as combobox. But I can't find this project. How to add cache entry to CMakeLists.txt with values constrained with combobox?

stnk
  • 13
  • 4

1 Answers1

0

You can set the a variable to a default value and add it to the cache.

set(COLOR_MODE "always" CACHE STRING "Should we use colors")

Then you can set the property for the variable to the list of values you want to appear in the combobox.

set_property(CACHE COLOR_MODE PROPERTY STRINGS always auto never)
stardust
  • 5,420
  • 1
  • 16
  • 20