diff options
author | Brad King <brad.king@kitware.com> | 2020-05-14 11:54:01 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-05-14 11:54:11 (GMT) |
commit | 73be779091e246706d50046198feb8b227757209 (patch) | |
tree | 2c2ffe7c661cf999d52b5d1a2e3f09ccb8ad95b1 /Tests/RunCMake | |
parent | 165da1068077bcffb3ee123bb8000b630c99c00f (diff) | |
parent | 549599bf324ac58b0b27f6ba3849806dfa65fc93 (diff) | |
download | CMake-73be779091e246706d50046198feb8b227757209.zip CMake-73be779091e246706d50046198feb8b227757209.tar.gz CMake-73be779091e246706d50046198feb8b227757209.tar.bz2 |
Merge topic 'cmake_command_preserve_args'
549599bf32 cmake_command: Preserve arguments to INVOKE function
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4741
Diffstat (limited to 'Tests/RunCMake')
3 files changed, 19 insertions, 0 deletions
diff --git a/Tests/RunCMake/cmake_command/RunCMakeTest.cmake b/Tests/RunCMake/cmake_command/RunCMakeTest.cmake index 2b6e7a2..0f12b80 100644 --- a/Tests/RunCMake/cmake_command/RunCMakeTest.cmake +++ b/Tests/RunCMake/cmake_command/RunCMakeTest.cmake @@ -5,6 +5,7 @@ run_cmake(cmake_command_unknown_meta_operation) run_cmake(cmake_command_invoke_message) run_cmake(cmake_command_invoke_message_fatal_error) run_cmake(cmake_command_invoke_no_parameters) +run_cmake(cmake_command_invoke_preserve_arguments) run_cmake(cmake_command_invoke_unknown_function) run_cmake(cmake_command_eval_message) run_cmake(cmake_command_eval_message_fatal_error) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_preserve_arguments-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_preserve_arguments-stderr.txt new file mode 100644 index 0000000..4670e60 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_preserve_arguments-stderr.txt @@ -0,0 +1,6 @@ +foo\(...\) +\[a;b\] +\[c;d\] +cmake_command\(INVOKE foo ...\) +\[a;b\] +\[c;d\] diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_preserve_arguments.cmake b/Tests/RunCMake/cmake_command/cmake_command_invoke_preserve_arguments.cmake new file mode 100644 index 0000000..53ac2e6 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_preserve_arguments.cmake @@ -0,0 +1,12 @@ +function(foo arg1 arg2) + math(EXPR last "${ARGC} - 1") + foreach(i RANGE 0 ${last}) + message("[${ARGV${i}}]") + endforeach() +endfunction() + +message("foo(...)") +foo("a;b" "c;d") + +message("cmake_command(INVOKE foo ...)") +cmake_command(INVOKE foo "a;b" "c;d") |