diff options
author | Dimitar Yordanov <dimitar.yordanov@sap.com> | 2016-02-12 12:21:12 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-02-12 16:19:40 (GMT) |
commit | c8c45a2c4e10715e5cf05acaa0ac2c80f28b9a6a (patch) | |
tree | 7e9300e1c0698c5783d6b8931a69c208ffd927a4 /Tests/RunCMake/cmake_parse_arguments | |
parent | a5a5a6857241c21d306661d723b749839f4c6e1a (diff) | |
download | CMake-c8c45a2c4e10715e5cf05acaa0ac2c80f28b9a6a.zip CMake-c8c45a2c4e10715e5cf05acaa0ac2c80f28b9a6a.tar.gz CMake-c8c45a2c4e10715e5cf05acaa0ac2c80f28b9a6a.tar.bz2 |
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@sap.com>
Signed-off-by: Matthias Maennich <matthias.maennich@sap.com>
Diffstat (limited to 'Tests/RunCMake/cmake_parse_arguments')
-rw-r--r-- | Tests/RunCMake/cmake_parse_arguments/CornerCases.cmake | 19 |
1 files changed, 19 insertions, 0 deletions
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) |