[cmake-developers] [PATCH] CMakeParseArguments: Test suite and native implementation

Matthias Männich matthias at maennich.net
Mon Dec 14 16:52:09 EST 2015


This is my pull request [1] brought to the list.

This adds a test suite for the CMakeParseArguments module. In addition
the second change implements cmake_parse_arguments(...) as native

In our project we saw that cmake_parse_arguments is actually called a
lot of times due to macro expansion and we could almost halve our
configure time by using a native implementation of
cmake_parse_arguments. This implementation follows the implementation
of the former macro and both implementations of course pass the added
test suite.

I added a third change that makes cmake_parse_arguments() emit a
warning in case keywords are specified more than once. An error
instead actually would break compatibility (which is why I also made
it a separate commit) for some probably unused corner cases. But in my
opinion this improves the implementation as I assume that most of the
duplicate specifications are actual errors that else get silently
ignored. In a later CMake version one could even emit an error in this
case but as it would break compatibility it should be introduced along
with a policy.

Best regards,



[1] https://github.com/Kitware/CMake/pull/202
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-cmake_parse_arguments-consider-duplicate-keyword-as-.patch
Type: text/x-patch
Size: 6426 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20151214/2a7740eb/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-CMakeParseArguments-replace-by-native-cmake_parse_ar.patch
Type: text/x-patch
Size: 23364 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20151214/2a7740eb/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-CMakeParseArguments-add-a-RunCMake-test-suite.patch
Type: text/x-patch
Size: 10433 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20151214/2a7740eb/attachment-0005.bin>

More information about the cmake-developers mailing list