[CMake-Promote] a ./configure shell script stub
Brandon J. Van Every
bvanevery at gmail.com
Mon May 29 06:45:40 EDT 2006
William A. Hoffman wrote:
> At 07:43 PM 5/28/2006, Brandon J. Van Every wrote:
>
>
>
>>> That is where it gets hard, because cmake has to be
>>> run before you can figure out what the options are. That is why I suggested creating
>>> an options file. It is not perfect because it could get out of date with the true
>>> options for the project. But, it would give people a way to document a project and
>>> have a better command line.
>>>
>>> cmake --help ../path/to/source
>>> This would read CMakeCommandLineOptions.cmake, and print out the options found in the
>>> file.
>>>
>>>
>> What is the motive for making it separate from CMakeLists.txt?
>>
> Because you have to parse the entire CMakeLists.txt tree, create a CMakeCache
> before you could implement --help.
Why can't you just have a command line options section in CMakeLists.txt
that gets a "privileged" parse? The parser would just look for that
section before looking for anything else. I am assuming that the
CMakeLists.txt author is going to specify command line options, and
would rather write everything inside of CMakeLists.txt, rather than
write 2 files. But perhaps your intent is that
CMakeCommandLineOptions.cmake is generated, which would make it a moot
point.
I think if you made the command line options static or "constantized," a
lot of these issues go away. Most of the problems seem to arise from a
perceived need to allow all kinds of dynamic flexibility in how command
line options are generated. If you make 'em just spell 'em out
statically, exactly as they're gonna be, then things should work fine.
Just don't allow dynamically generated command line options.
> And, even then, there is currently no way
> to map a cmake variable like CMAKE_INSTALL_PREFIX to some command line option
> like --prefix.
>
>
CMake parses command line options already... what is difficult about
adding more of them?
Cheers,
Brandon Van Every
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake-promote/attachments/20060529/ff10683d/attachment.htm
More information about the CMake-Promote
mailing list