[Cmake-commits] CMake branch, next, updated. v3.5.0-rc2-128-g2b1f8d5
Brad King
brad.king at kitware.com
Fri Feb 12 11:25:28 EST 2016
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 2b1f8d5217d2b179d976dfca1bf5982f6be06c00 (commit)
via c8c45a2c4e10715e5cf05acaa0ac2c80f28b9a6a (commit)
from 1c6bc3adaa84f5fb311f57e193e180530ea84702 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2b1f8d5217d2b179d976dfca1bf5982f6be06c00
commit 2b1f8d5217d2b179d976dfca1bf5982f6be06c00
Merge: 1c6bc3a c8c45a2
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Feb 12 11:25:27 2016 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Feb 12 11:25:27 2016 -0500
Merge topic 'fix-cmake_parse_arguments-expansion' into next
c8c45a2c cmake_parse_arguments: Restore ;-list argument flattening
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c8c45a2c4e10715e5cf05acaa0ac2c80f28b9a6a
commit c8c45a2c4e10715e5cf05acaa0ac2c80f28b9a6a
Author: Dimitar Yordanov <dimitar.yordanov at sap.com>
AuthorDate: Fri Feb 12 13:21:12 2016 +0100
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Feb 12 11:19:40 2016 -0500
cmake_parse_arguments: Restore ;-list argument flattening
The re-implementation in commit v3.5.0-rc1~116^2~1 (CMakeParseArguments:
replace by native cmake_parse_arguments command, 2015-12-05) introduced
a regression when parsing the ARGN arguments with cmake_parse_arguments.
The original implementation used
foreach(currentArg ${ARGN})
to iterate over input arguments. This flattened ;-lists within the
arguments whether they were quoted or not. Fix our new implementation
to preserve this behavior and add a test case to cover it.
Signed-off-by: Dimitar Yordanov <dimitar.yordanov at sap.com>
Signed-off-by: Matthias Maennich <matthias.maennich at sap.com>
diff --git a/Source/cmParseArgumentsCommand.cxx b/Source/cmParseArgumentsCommand.cxx
index a861965..ca76c88 100644
--- a/Source/cmParseArgumentsCommand.cxx
+++ b/Source/cmParseArgumentsCommand.cxx
@@ -97,10 +97,18 @@ bool cmParseArgumentsCommand
} insideValues = NONE;
std::string currentArgName;
- // now iterate over the remaining arguments
- // and fill in the values where applicable
+ // Flatten ;-lists in the arguments into a single list as was done
+ // by the original function(CMAKE_PARSE_ARGUMENTS).
+ list.clear();
for(; argIter != argEnd; ++argIter)
{
+ cmSystemTools::ExpandListArgument(*argIter, list);
+ }
+
+ // iterate over the arguments list and fill in the values where applicable
+ for (argIter = list.begin(), argEnd = list.end();
+ argIter != argEnd; ++argIter)
+ {
const options_map::iterator optIter = options.find(*argIter);
if (optIter != options.end())
{
diff --git a/Tests/RunCMake/cmake_parse_arguments/CornerCases.cmake b/Tests/RunCMake/cmake_parse_arguments/CornerCases.cmake
index 9a727dd..72c82ab 100644
--- a/Tests/RunCMake/cmake_parse_arguments/CornerCases.cmake
+++ b/Tests/RunCMake/cmake_parse_arguments/CornerCases.cmake
@@ -13,3 +13,22 @@ cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}"
TEST(MY_INSTALL_DESTINATION UNDEFINED)
TEST(MY_INSTALL_OPTIONAL TRUE)
+
+macro(foo)
+ set(_options )
+ set(_oneValueArgs FOO)
+ set(_multiValueArgs )
+ cmake_parse_arguments(_FOO2 "${_options}"
+ "${_oneValueArgs}"
+ "${_multiValueArgs}"
+ "${ARGN}")
+ cmake_parse_arguments(_FOO1 "${_options}"
+ "${_oneValueArgs}"
+ "${_multiValueArgs}"
+ ${ARGN})
+endmacro()
+
+foo(FOO foo)
+
+TEST(_FOO1_FOO foo)
+TEST(_FOO2_FOO foo)
-----------------------------------------------------------------------
Summary of changes:
Source/cmParseArgumentsCommand.cxx | 12 ++++++++++--
.../cmake_parse_arguments/CornerCases.cmake | 19 +++++++++++++++++++
2 files changed, 29 insertions(+), 2 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list