Proposal: cache entry groups
The Linux kernel's buildsystem has a hierarchical menu with options being grouped into different sub-menus, which makes things easier for the end user (they're not presented with a giant wall of options and can quickly find the one they care about.) I propose that we do something similar. We can add a property to cache entries called CACHE_GROUP
which will allow us to group them together in a meaningful way in ccmake
and cmake-gui
.
Here's an example of what this might look like:
add_cache_group(MODULES DESCRIPTION "Loadable Modules")
add_cache_group(FOO_MODULES DESCRIPTION "Foo Modules")
set_property(CACHE_GROUP FOO_MODULES PROPERTY PARENT MODULES)
option(BAR_MODULE "Bar Module" ON)
set_property(CACHE BAR_MODULE PROPERTY CACHE_GROUP FOO_MODULES)
option(DEBUGGING "Debugging" OFF)
In cmake-gui
, this would present as a expanding/collapsing tree view:
- Loadable Modules
- Foo Modules
BAR_MODULE
DEBUGGING
In ccmake
, rather than being a tree view, hitting enter on one of the cache groups would take you into the submenu for that group.