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?
Asked
Active
Viewed 25 times
1 Answers
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)
![](../../users/profiles/6271971.webp)
stardust
- 5,420
- 1
- 16
- 20