summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2020-05-07 13:09:40 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-05-07 13:09:52 (GMT)
commitb743ffbfa2b10709338c970037b5a663e375509d (patch)
tree7bbc8fc089d0c373c65f86f00c9a4632365c483c /Tests
parent51d82407fcd35a8995df194e5f6dd9d9eb3acd01 (diff)
parente4f1b301fecb9006cdb3153fb3575c6506be9ece (diff)
downloadCMake-b743ffbfa2b10709338c970037b5a663e375509d.zip
CMake-b743ffbfa2b10709338c970037b5a663e375509d.tar.gz
CMake-b743ffbfa2b10709338c970037b5a663e375509d.tar.bz2
Merge topic 'script-mode-and-arbitrary-args'
e4f1b301fe cmake: Allow arbitrary args passed to CMake script Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4707
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CommandLine/P_arbitrary_args.cmake3
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake1
2 files changed, 4 insertions, 0 deletions
diff --git a/Tests/RunCMake/CommandLine/P_arbitrary_args.cmake b/Tests/RunCMake/CommandLine/P_arbitrary_args.cmake
new file mode 100644
index 0000000..29faae3
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/P_arbitrary_args.cmake
@@ -0,0 +1,3 @@
+if(NOT ("${CMAKE_ARGV3}" STREQUAL "--" AND "${CMAKE_ARGV4}" STREQUAL "-DFOO"))
+ message(FATAL_ERROR "`-DFOO` shouldn't trigger an error after `--`")
+endif()
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 0f806bc..973391d 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -46,6 +46,7 @@ run_cmake_command(G_no-arg ${CMAKE_COMMAND} -B DummyBuildDir -G)
run_cmake_command(G_bad-arg ${CMAKE_COMMAND} -B DummyBuildDir -G NoSuchGenerator)
run_cmake_command(P_no-arg ${CMAKE_COMMAND} -P)
run_cmake_command(P_no-file ${CMAKE_COMMAND} -P nosuchscriptfile.cmake)
+run_cmake_command(P_arbitrary_args ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/P_arbitrary_args.cmake" -- -DFOO)
run_cmake_command(build-no-dir
${CMAKE_COMMAND} --build)