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
set (NVE_BUILD_ENGINE ON CACHE FORCE)
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":