[CMake] --enable-* with cmake

Eric Noulard eric.noulard at gmail.com
Wed Aug 8 10:51:35 EDT 2007


2007/8/8, Philip Lowman <philip at yhbt.com>:
> Eric Noulard wrote:
> >> However, neither approach seems to me as clean as what's available under
> >> autotools.
> >
> > I personnally think the OPTION CMake macro is just as good
> > as AC_ARG_ENABLE is.
>
> Almost.  Automake has a neat feature the original poster pointed out
> that uses arguments to AC_ARG_ENABLE to output documentation when you
> call "./configure --help".  CMake doesn't have an equivalent feature I
> know of for this but I think the closest would be a visual inspection of
> the variables in "ccmake" or "CMakeSetup.exe".

When you define an OPTION
you give a comment describing the OPTION like:

OPTION(BUILD_API_DOC  "Build doxygen documentation" OFF)

with ccmake and "CMakeSetup.exe"
you get the description line.

with ccmake you have it in the status line when you
select the option parameter line.
with "CMakeSetup.exe" I don't remember.

you may even run cmake in Wizard mode:

cmake -i

and you will get question like this one:
>>>>>>
Would you like to see advanced options? [No]:
Please wait while cmake processes CMakeLists.txt files....

Variable Name: BUILD_API_DOC
Description: Build doxygen documentation
Current Value: OFF
New Value (Enter to keep current value):
>>>>>>>

may be not exactly what you get with configure --help but
I find it pretty nice.
-- 
Erk


More information about the CMake mailing list