diff --git a/Source/CTest/cmCTestBuildAndTest.cxx b/Source/CTest/cmCTestBuildAndTest.cxx index b1c3a0456e..dd4a7bcb8a 100644 --- a/Source/CTest/cmCTestBuildAndTest.cxx +++ b/Source/CTest/cmCTestBuildAndTest.cxx @@ -8,8 +8,6 @@ #include #include -#include - #include "cmBuildArgs.h" #include "cmBuildOptions.h" #include "cmCTest.h" diff --git a/Source/cmBuildArgs.h b/Source/cmBuildArgs.h index 5e2d370ddf..b483b9dd8e 100644 --- a/Source/cmBuildArgs.h +++ b/Source/cmBuildArgs.h @@ -2,8 +2,7 @@ file LICENSE.rst or https://cmake.org/licensing for details. */ #pragma once -#include -#include +#include #include "cmDuration.h" @@ -14,7 +13,7 @@ public: static constexpr int DEFAULT_BUILD_PARALLEL_LEVEL = 0; std::string projectName; - cm::filesystem::path binaryDir; + std::string binaryDir; int jobs = NO_BUILD_PARALLEL_LEVEL; bool verbose = false; std::string config; diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 61998c1ac6..836947568d 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -13,7 +13,6 @@ #include #include -#include #include #include #include @@ -2225,8 +2224,8 @@ int cmGlobalGenerator::Build(cmBuildArgs const& buildArgs, /** * Run an executable command and put the stdout in output. */ - cmWorkingDirectory workdir(buildArgs.binaryDir.string()); - ostr << "Change Dir: '" << buildArgs.binaryDir.string() << '\'' << std::endl; + cmWorkingDirectory workdir(buildArgs.binaryDir); + ostr << "Change Dir: '" << buildArgs.binaryDir << '\'' << std::endl; if (workdir.Failed()) { cmSystemTools::SetRunCommandHideConsole(hideconsole); std::string const& err = workdir.GetError(); @@ -2246,9 +2245,9 @@ int cmGlobalGenerator::Build(cmBuildArgs const& buildArgs, std::string outputBuf; std::vector makeCommand = this->GenerateBuildCommand( - makeCommandCSTR, buildArgs.projectName, buildArgs.binaryDir.string(), - targets, realConfig, buildArgs.jobs, buildArgs.verbose, buildOptions, - nativeOptions, isInTryCompile); + makeCommandCSTR, buildArgs.projectName, buildArgs.binaryDir, targets, + realConfig, buildArgs.jobs, buildArgs.verbose, buildOptions, nativeOptions, + isInTryCompile); // Workaround to convince some commands to produce output. if (outputMode == cmSystemTools::OUTPUT_PASSTHROUGH && @@ -2260,8 +2259,8 @@ int cmGlobalGenerator::Build(cmBuildArgs const& buildArgs, if (buildOptions.Clean) { std::vector cleanCommand = this->GenerateBuildCommand(makeCommandCSTR, buildArgs.projectName, - buildArgs.binaryDir.string(), { "clean" }, - realConfig, buildArgs.jobs, buildArgs.verbose, + buildArgs.binaryDir, { "clean" }, realConfig, + buildArgs.jobs, buildArgs.verbose, buildOptions); ostr << "\nRun Clean Command: " << cleanCommand.front().QuotedPrintable() << std::endl; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index f635a2a1b2..95dce3a2ef 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -16,7 +16,6 @@ #include #include -#include #include #include #include @@ -3962,13 +3961,12 @@ int cmake::Build(cmBuildArgs buildArgs, std::vector targets, } #endif - if (!cmSystemTools::FileIsDirectory(buildArgs.binaryDir.string())) { - std::cerr << "Error: " << buildArgs.binaryDir.string() - << " is not a directory\n"; + if (!cmSystemTools::FileIsDirectory(buildArgs.binaryDir)) { + std::cerr << "Error: " << buildArgs.binaryDir << " is not a directory\n"; return 1; } - std::string cachePath = FindCacheFile(buildArgs.binaryDir.string()); + std::string cachePath = FindCacheFile(buildArgs.binaryDir); if (!this->LoadCache(cachePath)) { std::cerr << "Error: not a CMake build directory (missing CMakeCache.txt)\n"; @@ -4069,7 +4067,7 @@ int cmake::Build(cmBuildArgs buildArgs, std::vector targets, } #if !defined(CMAKE_BOOTSTRAP) - cmInstrumentation instrumentation(buildArgs.binaryDir.string()); + cmInstrumentation instrumentation(buildArgs.binaryDir); if (instrumentation.HasErrors()) { return 1; } diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index af223cf15e..fe5f35da7a 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -15,7 +15,6 @@ #include #include -#include #include #include @@ -449,7 +448,7 @@ int extract_job_number(std::string const& command, return jobs; } std::function extract_job_number_lambda_builder( - cm::filesystem::path& dir, int& jobs, std::string const& flag) + std::string& dir, int& jobs, std::string const& flag) { return [&dir, &jobs, flag](std::string const& value) -> bool { jobs = extract_job_number(flag, value); @@ -805,7 +804,7 @@ int do_install(int ac, char const* const* av) std::string component; std::string defaultDirectoryPermissions; std::string prefix; - cm::filesystem::path dir; + std::string dir; int jobs = 0; bool strip = false; bool verbose = cmSystemTools::HasEnv("VERBOSE"); @@ -919,8 +918,8 @@ int do_install(int ac, char const* const* av) args.emplace_back("-P"); - cmInstrumentation instrumentation(dir.string()); - auto handler = cmInstallScriptHandler(dir.string(), component, config, args); + cmInstrumentation instrumentation(dir); + auto handler = cmInstallScriptHandler(dir, component, config, args); int ret = 0; if (!jobs && handler.IsParallel()) { jobs = 1;