diff options
author | Brad King <brad.king@kitware.com> | 2016-02-12 16:25:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-02-12 16:25:36 (GMT) |
commit | 229a5bc9034549c8d9693878b1031b5f886eb1b7 (patch) | |
tree | 6d41b86712bcc8d52f144cb98aac96c3c798155a | |
parent | 2410a20ebb01e6ff88f7bbd43e1d65fcd9385d09 (diff) | |
parent | c8c45a2c4e10715e5cf05acaa0ac2c80f28b9a6a (diff) | |
download | CMake-229a5bc9034549c8d9693878b1031b5f886eb1b7.zip CMake-229a5bc9034549c8d9693878b1031b5f886eb1b7.tar.gz CMake-229a5bc9034549c8d9693878b1031b5f886eb1b7.tar.bz2 |
Merge branch 'fix-cmake_parse_arguments-expansion' into release
-rw-r--r-- | Source/cmParseArgumentsCommand.cxx | 12 | ||||
-rw-r--r-- | Tests/RunCMake/cmake_parse_arguments/CornerCases.cmake | 19 |
2 files changed, 29 insertions, 2 deletions
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) |