[CMake] Can CMake prompt the user for input while it's running?

Eric Noulard eric.noulard at gmail.com
Sun Feb 28 06:37:00 EST 2010


2010/2/28 Naram Qashat <cyberbotx at cyberbotx.com>:
>> Now since there is a "Grouped View" based on var name in CMake gui
>> you should be able to emulate what you want using
>> "conditionnal" option + cmake gui + grouped view.
>
> Most of our users are compiling our program under *nix and will not be using
> a GUI, which is why I was looking for a prompting solution instead.

OK I see.

> The suggestion in another part of this thread about using cmake -i won't just it
> due to the number of options that come up that would be confusing to users.

Did you try ccmake ? (The "TUI" curse interface)
It should work on any text terminal and shows OPTION/VARS in alphabetical order
such that if you name your options beginning with "0_User_xxxxx"
they should come up first in the menu.

Then there is no "prompt" but the user can toggle ON/OFF option easily
and give appropriate value for other needed-to-be defined vars.

ccmake require the user to hit 'c' (configure) as many time as needed
before he can hit 'g' for generating the underlying build files.

Off course ccmake authorize the user to change other var/option
but on the contrary of cmake -i he won't be prompt to do it.

Note that your need makes me think of a may-be nice feature request
that would be to be able to 'tag' variables/option in order to be able to select
what should be shown/asked to the user.

aka something like a meta information about a variable,
currently there is one meta-info which CACHE which is
controlled by set and/or mark_as_advanced.

We may imagine a USER meta-info or even a list of "tag"
which may be used by cmake -i/ccmake/cmake-gui
in order to filter out unwanted var.

For example adding a:

tag_as(TAG <tagvalue> VAR VAR2 VAR...)
would be used to tag a list of var

and
show_only(<taglist>)

may indicate cmake tools to only show the vars
corresponding to te tag list.

Off course the cmake UI would authorize to unfilter all vars
just as today there is the advanced/normal view.
-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list