From 78e8f1145670ad7326c4d06502315741805aa304 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Tue, 1 Mar 2022 16:37:37 -0500 Subject: cmake: Correct regression in `-B ` Fixes: #23285 --- Source/cmake.cxx | 2 +- Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index fe4d252..f9e2d6e 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1556,7 +1556,7 @@ bool cmake::SetDirectoriesFromFile(const std::string& arg) // This function is called multiple times with the same path if (is_source_dir) { this->SetHomeDirectoryViaCommandLine(listPath, HomeDirArgStyle::Plain); - if (!no_build_tree) { + if (no_build_tree) { std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); this->SetHomeOutputDirectory(cwd); } diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 61527a8..8084983 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -202,6 +202,7 @@ message(STATUS "CMAKE_BINARY_DIR='${CMAKE_BINARY_DIR}'") run_cmake_with_options(ExplicitDirs-C_buildsrcdir -B DummyBuildDir -S ${RunCMake_SOURCE_DIR}/C_buildsrcdir/src -C initial-cache.txt) # Test that full path works, too. run_cmake_with_options(ExplicitDirs-C_buildsrcdir -B DummyBuildDir -S ${RunCMake_SOURCE_DIR}/C_buildsrcdir/src -C ${RunCMake_TEST_BINARY_DIR}/initial-cache.txt) + run_cmake_with_options(ExplicitDirs-C_buildsrcdir -B DummyBuildDir ${RunCMake_SOURCE_DIR}/C_buildsrcdir/src -C ${RunCMake_TEST_BINARY_DIR}/initial-cache.txt) endfunction() run_ExplicitDirs() -- cgit v0.12