[Cmake] Interactive build options

Eric Wing ewing2121 at yahoo.com
Thu, 20 May 2004 16:56:13 -0700 (PDT)


Hello,
I'm working on a project that builds many libraries
and executables. In many cases, other developers may
not want to build everything and they would like a way
to selectively build what they want.

With CMake, I believe I can accomplish this by giving
each piece an OPTION(). However, because we have many
targets, I've been asked if there is a way to make
selection a little more manageable because resetting
every option one by one can be tedious. 

First, I thought about having a "Build All" option
that can be selected and deselected. When deselected,
I would like all the target options to appear. When
selected, it would be nice if all the target options
would disappear (so not to confuse the user). But when
I tried this out, once the options get displayed, I
was unable to make them disappear.

So then I thought about a toggle button action. If the
user triggers the action, (perhaps this could be
implemented as an OPTION too), all target options
should be set to ON. And when triggered the other way,
all should be off. But when I tried a simple
implementation of it using OPTION, I was unable to
change the values visible in the CMake interface
window.

Is there a way to accomplish this general idea?

Thanks,
Eric