Browse Source

cmake: Remove unnecessary initialization of empty source and build paths

The explicit initialization with empty paths from commit 57bdc1a2f7
(cmState: Compute and store directory components., 2015-05-04,
v3.3.0-rc1~61^2~4) has not been needed since commit 6afd35b98a (cmState:
remove unused code, 2016-06-16, v3.7.0-rc1~90^2).
Brad King 1 month ago
parent
commit
4a2d32e7c4

+ 0 - 2
Source/CPack/cmCPackGenerator.cxx

@@ -761,8 +761,6 @@ int cmCPackGenerator::InstallCMakeProject(
   }
 
   cmake cm(cmake::RoleScript, cmState::CPack);
-  cm.SetHomeDirectory("");
-  cm.SetHomeOutputDirectory("");
   cm.GetCurrentSnapshot().SetDefaultDefinitions();
   cm.AddCMakePaths();
   cm.SetProgressCallback([this](std::string const& msg, float prog) {

+ 0 - 2
Source/CPack/cpack.cxx

@@ -226,8 +226,6 @@ int main(int argc, char const* const* argv)
   };
 
   cmake cminst(cmake::RoleScript, cmState::CPack);
-  cminst.SetHomeDirectory("");
-  cminst.SetHomeOutputDirectory("");
   cminst.SetProgressCallback(cpackProgressCallback);
   cminst.GetCurrentSnapshot().SetDefaultDefinitions();
   cmGlobalGenerator cmgg(&cminst);

+ 0 - 2
Source/CTest/cmCTestBuildAndTest.cxx

@@ -178,8 +178,6 @@ int cmCTestBuildAndTest::Run()
   }
 
   cmake cm(cmake::RoleProject, cmState::Project);
-  cm.SetHomeDirectory("");
-  cm.SetHomeOutputDirectory("");
   cmCTestBuildAndTestCaptureRAII captureRAII(cm);
   static_cast<void>(captureRAII);
 

+ 0 - 2
Source/CTest/cmCTestLaunch.cxx

@@ -406,8 +406,6 @@ int cmCTestLaunch::Main(int argc, char const* const argv[], Op operation)
 void cmCTestLaunch::LoadConfig()
 {
   cmake cm(cmake::RoleScript, cmState::CTest);
-  cm.SetHomeDirectory("");
-  cm.SetHomeOutputDirectory("");
   cm.GetCurrentSnapshot().SetDefaultDefinitions();
   cmGlobalGenerator gg(&cm);
   cmMakefile mf(&gg, cm.GetCurrentSnapshot());

+ 0 - 2
Source/CTest/cmCTestScriptHandler.cxx

@@ -173,8 +173,6 @@ void cmCTestScriptHandler::CreateCMake()
 {
   // create a cmake instance to read the configuration script
   this->CMake = cm::make_unique<cmake>(cmake::RoleScript, cmState::CTest);
-  this->CMake->SetHomeDirectory("");
-  this->CMake->SetHomeOutputDirectory("");
   this->CMake->GetCurrentSnapshot().SetDefaultDefinitions();
   this->CMake->AddCMakePaths();
   this->CMake->SetWorkingMode(cmake::SCRIPT_MODE,

+ 0 - 2
Source/CTest/cmCTestTestHandler.cxx

@@ -1755,8 +1755,6 @@ bool cmCTestTestHandler::GetListOfTests()
   cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
                      "Constructing a list of tests" << std::endl, this->Quiet);
   cmake cm(cmake::RoleScript, cmState::CTest);
-  cm.SetHomeDirectory("");
-  cm.SetHomeOutputDirectory("");
   cm.GetCurrentSnapshot().SetDefaultDefinitions();
   cmGlobalGenerator gg(&cm);
   cmMakefile mf(&gg, cm.GetCurrentSnapshot());

+ 0 - 2
Source/CursesDialog/ccmake.cxx

@@ -76,8 +76,6 @@ int main(int argc, char const* const* argv)
   doc.addCMakeStandardDocSections();
   if (doc.CheckOptions(argc, argv)) {
     cmake hcm(cmake::RoleInternal, cmState::Help);
-    hcm.SetHomeDirectory("");
-    hcm.SetHomeOutputDirectory("");
     hcm.AddCMakePaths();
     auto generators = hcm.GetGeneratorsDocumentation();
     doc.SetName("ccmake");

+ 0 - 2
Source/QtDialog/CMakeSetup.cxx

@@ -83,8 +83,6 @@ int main(int argc, char** argv)
   if (argc2 > 1 && doc.CheckOptions(argc2, argv2)) {
     // Construct and print requested documentation.
     cmake hcm(cmake::RoleInternal, cmState::Help);
-    hcm.SetHomeDirectory("");
-    hcm.SetHomeOutputDirectory("");
     hcm.AddCMakePaths();
 
     auto generators = hcm.GetGeneratorsDocumentation();

+ 0 - 2
Source/cmCTest.cxx

@@ -2657,8 +2657,6 @@ int cmCTest::ExecuteTests(std::vector<std::string> const& args)
 
   {
     cmake cm(cmake::RoleScript, cmState::CTest);
-    cm.SetHomeDirectory("");
-    cm.SetHomeOutputDirectory("");
     cm.GetCurrentSnapshot().SetDefaultDefinitions();
     cmGlobalGenerator gg(&cm);
     cmMakefile mf(&gg, cm.GetCurrentSnapshot());

+ 0 - 2
Source/cmGraphVizWriter.cxx

@@ -196,8 +196,6 @@ void cmGraphVizWriter::ReadSettings(
   std::string const& fallbackSettingsFileName)
 {
   cmake cm(cmake::RoleScript, cmState::Unknown);
-  cm.SetHomeDirectory("");
-  cm.SetHomeOutputDirectory("");
   cm.GetCurrentSnapshot().SetDefaultDefinitions();
   cmGlobalGenerator ggi(&cm);
   cmMakefile mf(&ggi, cm.GetCurrentSnapshot());

+ 0 - 7
Source/cmake.cxx

@@ -3474,8 +3474,6 @@ int cmake::CheckBuildSystem()
   // global generate.
   // Actually, all we need is the `set` command.
   cmake cm(RoleScript, cmState::Unknown);
-  cm.SetHomeDirectory("");
-  cm.SetHomeOutputDirectory("");
   cm.GetCurrentSnapshot().SetDefaultDefinitions();
   cmGlobalGenerator gg(&cm);
   cmMakefile mf(&gg, cm.GetCurrentSnapshot());
@@ -3816,9 +3814,6 @@ int cmake::Build(int jobs, std::string dir, std::vector<std::string> targets,
                  std::string const& presetName, bool listPresets,
                  std::vector<std::string> const& args)
 {
-  this->SetHomeDirectory("");
-  this->SetHomeOutputDirectory("");
-
 #if !defined(CMAKE_BOOTSTRAP)
   if (!presetName.empty() || listPresets) {
     this->SetHomeDirectory(cmSystemTools::GetLogicalWorkingDirectory());
@@ -4084,8 +4079,6 @@ int cmake::Build(int jobs, std::string dir, std::vector<std::string> targets,
 
 bool cmake::Open(std::string const& dir, DryRun dryRun)
 {
-  this->SetHomeDirectory("");
-  this->SetHomeOutputDirectory("");
   if (!cmSystemTools::FileIsDirectory(dir)) {
     if (dryRun == DryRun::No) {
       std::cerr << "Error: " << dir << " is not a directory\n";

+ 0 - 8
Source/cmakemain.cxx

@@ -222,8 +222,6 @@ int do_cmake(int ac, char const* const* av)
   if (doc.CheckOptions(ac, av, "--")) {
     // Construct and print requested documentation.
     cmake hcm(cmake::RoleInternal, cmState::Help);
-    hcm.SetHomeDirectory("");
-    hcm.SetHomeOutputDirectory("");
     hcm.AddCMakePaths();
 
     // the command line args are processed here so that you can do
@@ -362,8 +360,6 @@ int do_cmake(int ac, char const* const* av)
 
   if (sysinfo) {
     cmake cm(cmake::RoleProject, cmState::Project);
-    cm.SetHomeDirectory("");
-    cm.SetHomeOutputDirectory("");
     int ret = cm.GetSystemInformation(parsedArgs);
     return ret;
   }
@@ -386,8 +382,6 @@ int do_cmake(int ac, char const* const* av)
     ? cmake::CommandFailureAction::EXIT_CODE
     : cmake::CommandFailureAction::FATAL_ERROR;
   cmake cm(role, mode);
-  cm.SetHomeDirectory("");
-  cm.SetHomeOutputDirectory("");
   cmSystemTools::SetMessageCallback(
     [&cm](std::string const& msg, cmMessageMetadata const& md) {
       cmakemainMessageCallback(msg, md, &cm);
@@ -975,8 +969,6 @@ int do_install(int ac, char const* const* av)
         cm.SetProgressCallback([&cm](std::string const& msg, float prog) {
           cmakemainProgressCallback(msg, prog, &cm);
         });
-        cm.SetHomeDirectory("");
-        cm.SetHomeOutputDirectory("");
         cm.SetDebugOutputOn(verbose);
         cm.SetWorkingMode(cmake::SCRIPT_MODE,
                           cmake::CommandFailureAction::FATAL_ERROR);