[CMake-Promote] Re: CMake-Promote Digest, Vol 6, Issue 3

William A. Hoffman billlist at nycap.rr.com
Mon May 29 13:38:00 EDT 2006


At 01:14 PM 5/29/2006, Axel Roebel wrote:
>On Monday 29 May 2006 18:01,  William A. Hoffman wrote:
>> To work with the options, it is best to use ccmake or CMakeSetup, or even
>> cmake -i.   To let people work from the command line we added the abilitiy
>> to use -DVAR=VALUE from the command line.  What this does is pre-load
>> the CMakeCache.txt with the VAR.   The VAR may or may not be even used in
>> the project, cmake does not care.   To implement --help correctly, you
>> would have to configure the entire project first.   My suggestion was to
>> create an extra file that could be parsed at --help time, it would be small
>> and easy to parse, and not require parsing the entire tree.   It would
>> provide a map from VAR name to --commandline name.  It would be read by
>> cmake and allow the project to specify its options in one place, and make
>> it easier to implement --help, and add a way to specify a mapping from
>> --option to a VAR name.
>
>Why not have the do nothing parser mode that displays all
>help strings of all options that are currently available?
>Together with the warning at the end of running cmake
>whenever the options did change, you would have all
>that is needed for command line operations!
> 

I suppose you could do this.   I think there is still a need for some way
to map from cmake variables to more command line friendly versions.  Even
if -help said you could do -DCMAKE_INSTALL_PREFIX=path, I don't think
it would make people happy.   They will want --prefix=.

Maybe something like:

set_variable_property(CMAKE_INSTALL_PREFIX COMMNAD_LINE_OPT "--prefix")

There is also a logistics issue.   The configure script is part of the project.
cmake is not.  So, to get help for a project in the "do nothing" parser mode,
you will still have to tell cmake where the source tree is, and where the binary tree
is (in case cmake has already been run).  It will have to have the same options
as actually running cmake.  

cmake --help ../path/to/source
or
cmake --help .  (where . is a configured binary tree, or a source tree)


-Bill




More information about the CMake-Promote mailing list