summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
diff options
context:
space:
mode:
authorRobert Maynard <rmaynard@nvidia.com>2022-02-14 15:23:46 (GMT)
committerBrad King <brad.king@kitware.com>2022-02-16 17:11:33 (GMT)
commitf73457ca2ecb7abe66050910d74a37f80d10de2e (patch)
treee629aff9fdbe7956852b94746d22c690ed21597c /Tests/RunCMake/CommandLine/RunCMakeTest.cmake
parent67f97f54789413f47a0f03a36c3bb32518a2e922 (diff)
downloadCMake-f73457ca2ecb7abe66050910d74a37f80d10de2e.zip
CMake-f73457ca2ecb7abe66050910d74a37f80d10de2e.tar.gz
CMake-f73457ca2ecb7abe66050910d74a37f80d10de2e.tar.bz2
cmake: Ignore any empty "" command line arguments
Don't treat empty quote arguments("") as the current working directory but instead ignore them. Fixes #23217
Diffstat (limited to 'Tests/RunCMake/CommandLine/RunCMakeTest.cmake')
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 033fbe6..5944d2d 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -7,6 +7,10 @@ run_cmake_command(InvalidArg1 ${CMAKE_COMMAND} -invalid)
run_cmake_command(InvalidArg2 ${CMAKE_COMMAND} --invalid)
run_cmake_command(Wizard ${CMAKE_COMMAND} -i)
run_cmake_command(C-no-arg ${CMAKE_COMMAND} -B DummyBuildDir -C)
+run_cmake_command(C-no-arg2 ${CMAKE_COMMAND} -B DummyBuildDir -C -T)
+set(RunCMake_TEST_RAW_ARGS [[-C ""]])
+run_cmake_command(C-no-arg3 ${CMAKE_COMMAND} -B DummyBuildDir)
+unset(RunCMake_TEST_RAW_ARGS)
run_cmake_command(C-no-file ${CMAKE_COMMAND} -B DummyBuildDir -C nosuchcachefile.txt)
run_cmake_command(Cno-file ${CMAKE_COMMAND} -B DummyBuildDir -Cnosuchcachefile.txt)
run_cmake_command(cache-no-file ${CMAKE_COMMAND} nosuchsubdir/CMakeCache.txt)
@@ -158,8 +162,11 @@ endif()
run_cmake_with_options(S-arg-reverse-order ${binary_dir} -S${source_dir} )
run_cmake_with_options(S-no-arg -S )
run_cmake_with_options(S-no-arg2 -S -T)
+ run_cmake_with_raw_args(S-no-arg3 [[-S ""]])
run_cmake_with_options(S-B -S ${source_dir} -B ${binary_dir})
run_cmake_with_options(S-B-extra-path -S ${source_dir} -B ${binary_dir} /extra/path/)
+ run_cmake_with_raw_args(S-B-non-path "-S \"${source_dir}\" -B \"${binary_dir}\" \"\"")
+ run_cmake_with_raw_args(S-B-non-path2 "-S \"${source_dir}\" \"\" -B \"${binary_dir}\"")
# make sure that -B can explicitly construct build directories
file(REMOVE_RECURSE "${binary_dir}")
@@ -168,6 +175,7 @@ endif()
run_cmake_with_options(B-arg-reverse-order ${source_dir} -B${binary_dir})
run_cmake_with_options(B-no-arg -B )
run_cmake_with_options(B-no-arg2 -B -T)
+ run_cmake_with_raw_args(B-no-arg3 [[-B ""]])
file(REMOVE_RECURSE "${binary_dir}")
run_cmake_with_options(B-S -B${binary_dir} -S${source_dir})
run_cmake_with_options(B-S-extra-path -B${binary_dir} -S${source_dir} /extra/path/)