[CMake] Disabling Argument Parsing in CMake -P Scripts
David Cole
david.cole at kitware.com
Fri Nov 2 05:45:38 EDT 2012
"--" for script mode is a good idea. (Actually, if we had this for
non-script mode even, it would then make sense to expose the command
line arguments in similar variables even when configuring a CMakeLists
file. Presently, the CMAKE_ARGVn vars are only available in script
mode.)
Can you propose a patch?
If so, open a feature request in the bug tracker, and attach a "git
format-patch -1" file.
Thanks,
David
On Fri, Nov 2, 2012 at 12:21 AM, Eskandar Ensafi
<Ensafi at spacecomputer.com> wrote:
> Hello,
>
> I often find it very useful to run CMake scripts of the form "cmake -P script-name arg1 arg2 ..." as a cross-platform scripting solution that doesn't rely on Perl, Python, etc. One major limitation is that CMake continues to parse all arguments after the script name. For example, if arg1 is "-i" then CMake will enter wizard mode before executing the script, and options such as "-D", "-G" and "-L" will be parsed and removed from the command-line by CMake. The current behavior limits the flexibility of CMake's script mode by making it impossible to pass arbitrary options to be parsed directly by the script.
>
> It would be great if I could somehow specify "cmake -P script-name -- arg1 arg2 ..." to tell CMake to stop parsing all subsequent arguments while still placing arg1, arg2, etc. in the CMAKE_ARGVn variables. If the "--" flag is potentially problematic and may pose compatibility problems, perhaps another syntax can be adopted, such as "cmake -PP script-name arg1 arg2 ..." where -P is doubled.
>
> Is this something that can be easily implemented?
>
> Best,
>
> Eskandar
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
More information about the CMake
mailing list