diff options
author | Brad King <brad.king@kitware.com> | 2022-01-21 14:17:13 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-01-21 14:17:27 (GMT) |
commit | b23f57f30732c4874f5b9e506be41b9f9817392b (patch) | |
tree | f33cbca696a0238d8030b4000a4f04650385a9ef /Tests | |
parent | a86e42a0f53bb3920fa8a9113a40f0ab718c0788 (diff) | |
parent | eacf1f879b0933509efbd4fb4d6d72ce99412aa7 (diff) | |
download | CMake-b23f57f30732c4874f5b9e506be41b9f9817392b.zip CMake-b23f57f30732c4874f5b9e506be41b9f9817392b.tar.gz CMake-b23f57f30732c4874f5b9e506be41b9f9817392b.tar.bz2 |
Merge topic 'cmake-warn-extra-paths'
eacf1f879b cmake: Warn about unnecessary paths on command line
a4f076110d Tests: Fix RunCMake.CommandLine toolchain case command line
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6882
Diffstat (limited to 'Tests')
4 files changed, 17 insertions, 2 deletions
diff --git a/Tests/RunCMake/CommandLine/B-S-extra-path-stderr.txt b/Tests/RunCMake/CommandLine/B-S-extra-path-stderr.txt new file mode 100644 index 0000000..8794f74 --- /dev/null +++ b/Tests/RunCMake/CommandLine/B-S-extra-path-stderr.txt @@ -0,0 +1,4 @@ +^CMake Warning: + Ignoring extra path from command line: + + /extra/path/$ diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 3622e64..033fbe6 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -143,6 +143,10 @@ endif() run_cmake_with_options(S-arg-build-dir-not-created -S ${source_dir} build/) run_cmake_with_options(S-arg-reverse-build-dir-not-created build/ -S${source_dir} ) + file(REMOVE_RECURSE "${source_dir}/build") + file(MAKE_DIRECTORY "${source_dir}/build") + run_cmake_with_options(S-arg-build-dir-empty -S ${source_dir} build/) + set(source_dir ${RunCMake_SOURCE_DIR}/ExplicitDirs) set(binary_dir ${RunCMake_BINARY_DIR}/ExplicitDirs-build) @@ -155,6 +159,7 @@ endif() run_cmake_with_options(S-no-arg -S ) run_cmake_with_options(S-no-arg2 -S -T) 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/) # make sure that -B can explicitly construct build directories file(REMOVE_RECURSE "${binary_dir}") @@ -165,6 +170,7 @@ endif() run_cmake_with_options(B-no-arg2 -B -T) 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/) message("copied to ${RunCMake_TEST_BINARY_DIR}/initial-cache.txt") file(COPY ${RunCMake_SOURCE_DIR}/C_buildsrcdir/initial-cache.txt DESTINATION ${RunCMake_TEST_BINARY_DIR}) @@ -196,7 +202,7 @@ function(run_Toolchain) set(CMAKE_SYSTEM_NAME Linux) set(toolchain_file binary_dir) ]=]) - run_cmake_with_options(toolchain-valid-rel-build-path ${CMAKE_COMMAND} -S ${source_dir} -B ${binary_dir} --toolchain toolchain.cmake) + run_cmake_with_options(toolchain-valid-rel-build-path -S ${source_dir} -B ${binary_dir} --toolchain toolchain.cmake) endfunction() run_Toolchain() diff --git a/Tests/RunCMake/CommandLine/S-B-extra-path-stderr.txt b/Tests/RunCMake/CommandLine/S-B-extra-path-stderr.txt new file mode 100644 index 0000000..8794f74 --- /dev/null +++ b/Tests/RunCMake/CommandLine/S-B-extra-path-stderr.txt @@ -0,0 +1,4 @@ +^CMake Warning: + Ignoring extra path from command line: + + /extra/path/$ diff --git a/Tests/RunCMake/CommandLine/toolchain-valid-rel-build-path-stderr.txt b/Tests/RunCMake/CommandLine/toolchain-valid-rel-build-path-stderr.txt index 1980051..0475546 100644 --- a/Tests/RunCMake/CommandLine/toolchain-valid-rel-build-path-stderr.txt +++ b/Tests/RunCMake/CommandLine/toolchain-valid-rel-build-path-stderr.txt @@ -1 +1,2 @@ -^CMake Error.*binary_dir +^CMake Error at CMakeLists.txt:[0-9] \(message\): + binary_dir$ |