Creating CMake parameter groups

I use CMake to control the assembly of projects on Linux, not with a single project, but the principle is the same. Each project has its own set of options, for example, DEVELswitches and custom code for inclusion. They are added to the standard CMake path:

OPTION(NAME "Helpstring" VALUE)

I am looking for a way to group these parameters based on which project they belong to, since they are currently arranged in alphabetical order and can be quite confusing. It will also save me unique names for each parameter, for example, the parameter DEVELcan be applied to all projects, but I can only enable it on some. I do not want to write, for example. PROJECTNAME_DEVEL.

Ideally, I would like the system to share the parameters based on the project, for example.

PROJECT1NAME:
    DEVEL: ON
PROJECT2NAME:
    DEVEL: OFF
    ANOTHER_OPTION: ON

Can I do it somehow? I primarily aimed at the ncurses interface on cmake, I see that the Qt interface can group records, so is this possible in the ncurses interface?

Greetings

+3
source share
1 answer

Both commentators are true here: the cmake-gui program (based on Qt) groups the parameters together based on the prefix to the first underscore.

The ccmake program (based on ncurses "gui") does not yet have the same grouping feature.

+3
source

Source: https://habr.com/ru/post/1760052/


All Articles