Merge topic 'emit_deprecate_wawrning_on_h_cmd_arg'

00388f8576 cmake-cli: Deprecate -H

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12520
This commit is contained in:
Brad King
2026-09-22 09:55:26 -04:00
committed by Kitware Robot
4 changed files with 9 additions and 1 deletions
+5 -1
View File
@@ -1107,7 +1107,11 @@ void cmake::SetArgs(std::vector<std::string> const& args)
CommandArgument::RequiresSeparator::No, SourceArgLambda },
CommandArgument{ "-H", "No source directory specified for -H",
CommandArgument::Values::One,
CommandArgument::RequiresSeparator::No, SourceArgLambda },
CommandArgument::RequiresSeparator::No,
[&](std::string const& value, cmake* state) -> bool {
warnDeprecated("-H", "-S");
return SourceArgLambda(value, state);
} },
CommandArgument{ "-O", CommandArgument::Values::Zero,
IgnoreAndTrueLambda },
CommandArgument{ "-B", "No build directory specified for -B",
@@ -0,0 +1 @@
^The -H option is deprecated\. Use -S instead\.$
@@ -0,0 +1,2 @@
-- CMAKE_SOURCE_DIR='[^']*/Tests/RunCMake/CommandLine/ExplicitDirs'
-- CMAKE_BINARY_DIR='[^']*/Tests/RunCMake/CommandLine/ExplicitDirs-build'
@@ -273,6 +273,7 @@ message(STATUS "CMAKE_BINARY_DIR='${CMAKE_BINARY_DIR}'")
file(REMOVE_RECURSE "${binary_dir}")
run_cmake_with_options(ExplicitDirs-S-arg -S ${source_dir} ${binary_dir})
run_cmake_with_options(ExplicitDirs-S-arg-reverse-order ${binary_dir} -S${source_dir} )
run_cmake_with_options(ExplicitDirs-H-arg -H${source_dir} ${binary_dir})
run_cmake_with_options(ExplicitDirs-S-no-arg -S )
run_cmake_with_options(ExplicitDirs-S-no-arg2 -S -T)
run_cmake_with_raw_args(ExplicitDirs-S-no-arg3 [[-S ""]])