Option dependencies

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Option dependencies

Jeroen Dierckx

We have a rather complex framework that we are converting to cmake. I
want to present the user with options to build some parts of our
framework or not. A lot of these options depend on others (when
building the Ogre rendering modules for example, our engine needs to
be built too).
I know I can use cmake_dependent_option, but this makes things too
confusing for the users (the ones building the framework I mean). In
that case, they first would have to enable building the engine before
they are presented with the option to build the Ogre targets, an
option which they can enable only then.

What I would want is that all these options are presented to the user,
but when they enable building the Ogre targets, the engine option is
automatically checked too. I can do this with the set function using
FORCE, but then I have to declare the whole variable again (with its
type and description). So what I would want is to force an existing
variable to ON, reflecting the change in the cmake GUI (so changing
the cached variable), but withouth having to declare it again.

Ideally I would be able to do the following:

  # Force the existing cached variable to ON
endif ()

I tried getting the description from an existing variable, but that
didn't work. I used the following code, which gave me a "NOT-FOUND":


I also tried FULL_DOCS, without succes.

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe: