[CMake] --enable-* with cmake
Brandon Van Every
bvanevery at gmail.com
Fri Aug 10 13:21:10 EDT 2007
On 8/10/07, Bill Hoffman <bill.hoffman at kitware.com> wrote:
> Brandon Van Every wrote:
> >
> >
> > It might be reasonable, however, to show OPTIONS resolved at the
> > current scope. And to note whether conditional options exist, i.e.
> > "Warning: conditional options detected. You are advised to run
> > (CMakeSetup|CCMake) and resolve them iteravely." Or the opposite:
> > "All options have been resolved."
> >
> There is no way to do this, because the code inside an if(FALSE) is
> never run, so there
> would be no way to know if an option command was being skipped.
Well, it's not strictly necessary to do the detection. There could be
static Caveat Emptor text saying, "Warning, additional options may be
available, you are advised to run CMake iteravely" or whatever the
proper wordsmithing would be.
You could take a count of the number of OPTION commands you've
actually run, and compare that to the number of OPTION commands in all
included files. If an OPTION is inside a loop or macro, you could
automatically issue the warning that there *may* be more options
available. I think realistically, a lot of CMakeScript.txt will have
"flat" OPTION specifications and a counting compare will work.
Proving that all options at this scope have been resolved may be more
difficult, or non-doable in some cases. But in some cases it is
doable.
>From the Autoconf retraining standpoint, "Some OPTIONs detected in
loops, you'll need to evaluate iteravely" is good geekery. It teaches
the Autoconf user that OPTIONs are not static.
On the other hand, static text saying "there may be conditional
OPTIONs, there may be dynamic OPTIONs" accomplishes the training
objective with no real work.
Cheers,
Brandon Van Every
More information about the CMake
mailing list