|
@@ -286,7 +286,7 @@ cmDocumentationEntry cmake::CMAKE_STANDARD_OPTIONS_TABLE[18] = {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
cmake::cmake(Role role, cmState::Mode mode, cmState::ProjectKind projectKind)
|
|
cmake::cmake(Role role, cmState::Mode mode, cmState::ProjectKind projectKind)
|
|
|
- : CMakeWorkingDirectory(cmSystemTools::GetCurrentWorkingDirectory())
|
|
|
|
|
|
|
+ : CMakeWorkingDirectory(cmSystemTools::GetLogicalWorkingDirectory())
|
|
|
, FileTimeCache(cm::make_unique<cmFileTimeCache>())
|
|
, FileTimeCache(cm::make_unique<cmFileTimeCache>())
|
|
|
#ifndef CMAKE_BOOTSTRAP
|
|
#ifndef CMAKE_BOOTSTRAP
|
|
|
, VariableWatch(cm::make_unique<cmVariableWatch>())
|
|
, VariableWatch(cm::make_unique<cmVariableWatch>())
|
|
@@ -637,8 +637,8 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
|
|
|
// Documented behavior of CMAKE{,_CURRENT}_{SOURCE,BINARY}_DIR is to be
|
|
// Documented behavior of CMAKE{,_CURRENT}_{SOURCE,BINARY}_DIR is to be
|
|
|
// set to $PWD for -P mode.
|
|
// set to $PWD for -P mode.
|
|
|
state->SetWorkingMode(SCRIPT_MODE);
|
|
state->SetWorkingMode(SCRIPT_MODE);
|
|
|
- state->SetHomeDirectory(cmSystemTools::GetCurrentWorkingDirectory());
|
|
|
|
|
- state->SetHomeOutputDirectory(cmSystemTools::GetCurrentWorkingDirectory());
|
|
|
|
|
|
|
+ state->SetHomeDirectory(cmSystemTools::GetLogicalWorkingDirectory());
|
|
|
|
|
+ state->SetHomeOutputDirectory(cmSystemTools::GetLogicalWorkingDirectory());
|
|
|
state->ReadListFile(args, path);
|
|
state->ReadListFile(args, path);
|
|
|
return true;
|
|
return true;
|
|
|
};
|
|
};
|
|
@@ -792,16 +792,16 @@ void cmake::ReadListFile(const std::vector<std::string>& args,
|
|
|
|
|
|
|
|
bool cmake::FindPackage(const std::vector<std::string>& args)
|
|
bool cmake::FindPackage(const std::vector<std::string>& args)
|
|
|
{
|
|
{
|
|
|
- this->SetHomeDirectory(cmSystemTools::GetCurrentWorkingDirectory());
|
|
|
|
|
- this->SetHomeOutputDirectory(cmSystemTools::GetCurrentWorkingDirectory());
|
|
|
|
|
|
|
+ this->SetHomeDirectory(cmSystemTools::GetLogicalWorkingDirectory());
|
|
|
|
|
+ this->SetHomeOutputDirectory(cmSystemTools::GetLogicalWorkingDirectory());
|
|
|
|
|
|
|
|
this->SetGlobalGenerator(cm::make_unique<cmGlobalGenerator>(this));
|
|
this->SetGlobalGenerator(cm::make_unique<cmGlobalGenerator>(this));
|
|
|
|
|
|
|
|
cmStateSnapshot snapshot = this->GetCurrentSnapshot();
|
|
cmStateSnapshot snapshot = this->GetCurrentSnapshot();
|
|
|
snapshot.GetDirectory().SetCurrentBinary(
|
|
snapshot.GetDirectory().SetCurrentBinary(
|
|
|
- cmSystemTools::GetCurrentWorkingDirectory());
|
|
|
|
|
|
|
+ cmSystemTools::GetLogicalWorkingDirectory());
|
|
|
snapshot.GetDirectory().SetCurrentSource(
|
|
snapshot.GetDirectory().SetCurrentSource(
|
|
|
- cmSystemTools::GetCurrentWorkingDirectory());
|
|
|
|
|
|
|
+ cmSystemTools::GetLogicalWorkingDirectory());
|
|
|
// read in the list file to fill the cache
|
|
// read in the list file to fill the cache
|
|
|
snapshot.SetDefaultDefinitions();
|
|
snapshot.SetDefaultDefinitions();
|
|
|
auto mfu = cm::make_unique<cmMakefile>(this->GetGlobalGenerator(), snapshot);
|
|
auto mfu = cm::make_unique<cmMakefile>(this->GetGlobalGenerator(), snapshot);
|
|
@@ -1471,10 +1471,10 @@ void cmake::SetArgs(const std::vector<std::string>& args)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (!haveSourceDir) {
|
|
if (!haveSourceDir) {
|
|
|
- this->SetHomeDirectory(cmSystemTools::GetCurrentWorkingDirectory());
|
|
|
|
|
|
|
+ this->SetHomeDirectory(cmSystemTools::GetLogicalWorkingDirectory());
|
|
|
}
|
|
}
|
|
|
if (!haveBinaryDir) {
|
|
if (!haveBinaryDir) {
|
|
|
- this->SetHomeOutputDirectory(cmSystemTools::GetCurrentWorkingDirectory());
|
|
|
|
|
|
|
+ this->SetHomeOutputDirectory(cmSystemTools::GetLogicalWorkingDirectory());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
#if !defined(CMAKE_BOOTSTRAP)
|
|
#if !defined(CMAKE_BOOTSTRAP)
|
|
@@ -1839,12 +1839,12 @@ bool cmake::SetDirectoriesFromFile(const std::string& arg)
|
|
|
this->SetHomeDirectoryViaCommandLine(listPath);
|
|
this->SetHomeDirectoryViaCommandLine(listPath);
|
|
|
if (no_build_tree) {
|
|
if (no_build_tree) {
|
|
|
this->SetHomeOutputDirectory(
|
|
this->SetHomeOutputDirectory(
|
|
|
- cmSystemTools::GetCurrentWorkingDirectory());
|
|
|
|
|
|
|
+ cmSystemTools::GetLogicalWorkingDirectory());
|
|
|
}
|
|
}
|
|
|
} else if (no_source_tree && no_build_tree) {
|
|
} else if (no_source_tree && no_build_tree) {
|
|
|
this->SetHomeDirectory(listPath);
|
|
this->SetHomeDirectory(listPath);
|
|
|
this->SetHomeOutputDirectory(
|
|
this->SetHomeOutputDirectory(
|
|
|
- cmSystemTools::GetCurrentWorkingDirectory());
|
|
|
|
|
|
|
+ cmSystemTools::GetLogicalWorkingDirectory());
|
|
|
} else if (no_build_tree) {
|
|
} else if (no_build_tree) {
|
|
|
this->SetHomeOutputDirectory(listPath);
|
|
this->SetHomeOutputDirectory(listPath);
|
|
|
}
|
|
}
|
|
@@ -1861,7 +1861,7 @@ bool cmake::SetDirectoriesFromFile(const std::string& arg)
|
|
|
// We didn't find a CMakeCache.txt and it wasn't specified
|
|
// We didn't find a CMakeCache.txt and it wasn't specified
|
|
|
// with -B. Assume the current working directory as the build tree.
|
|
// with -B. Assume the current working directory as the build tree.
|
|
|
this->SetHomeOutputDirectory(
|
|
this->SetHomeOutputDirectory(
|
|
|
- cmSystemTools::GetCurrentWorkingDirectory());
|
|
|
|
|
|
|
+ cmSystemTools::GetLogicalWorkingDirectory());
|
|
|
used_provided_path = false;
|
|
used_provided_path = false;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -2362,7 +2362,6 @@ int cmake::Configure()
|
|
|
int cmake::ActualConfigure()
|
|
int cmake::ActualConfigure()
|
|
|
{
|
|
{
|
|
|
// Construct right now our path conversion table before it's too late:
|
|
// Construct right now our path conversion table before it's too late:
|
|
|
- this->UpdateConversionPathTable();
|
|
|
|
|
this->CleanupCommandsAndMacros();
|
|
this->CleanupCommandsAndMacros();
|
|
|
|
|
|
|
|
cmSystemTools::RemoveADirectory(this->GetHomeOutputDirectory() +
|
|
cmSystemTools::RemoveADirectory(this->GetHomeOutputDirectory() +
|
|
@@ -3203,31 +3202,6 @@ void cmake::PrintGeneratorList()
|
|
|
#endif
|
|
#endif
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-void cmake::UpdateConversionPathTable()
|
|
|
|
|
-{
|
|
|
|
|
- // Update the path conversion table with any specified file:
|
|
|
|
|
- cmValue tablepath =
|
|
|
|
|
- this->State->GetInitializedCacheValue("CMAKE_PATH_TRANSLATION_FILE");
|
|
|
|
|
-
|
|
|
|
|
- if (tablepath) {
|
|
|
|
|
- cmsys::ifstream table(tablepath->c_str());
|
|
|
|
|
- if (!table) {
|
|
|
|
|
- cmSystemTools::Error("CMAKE_PATH_TRANSLATION_FILE set to " + *tablepath +
|
|
|
|
|
- ". CMake can not open file.");
|
|
|
|
|
- cmSystemTools::ReportLastSystemError("CMake can not open file.");
|
|
|
|
|
- } else {
|
|
|
|
|
- std::string a;
|
|
|
|
|
- std::string b;
|
|
|
|
|
- while (!table.eof()) {
|
|
|
|
|
- // two entries per line
|
|
|
|
|
- table >> a;
|
|
|
|
|
- table >> b;
|
|
|
|
|
- cmSystemTools::AddTranslationPath(a, b);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
int cmake::CheckBuildSystem()
|
|
int cmake::CheckBuildSystem()
|
|
|
{
|
|
{
|
|
|
// We do not need to rerun CMake. Check dependency integrity.
|
|
// We do not need to rerun CMake. Check dependency integrity.
|
|
@@ -3468,7 +3442,7 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
|
|
|
{
|
|
{
|
|
|
// so create the directory
|
|
// so create the directory
|
|
|
std::string resultFile;
|
|
std::string resultFile;
|
|
|
- std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
|
|
|
|
|
|
|
+ std::string cwd = cmSystemTools::GetLogicalWorkingDirectory();
|
|
|
std::string destPath = cwd + "/__cmake_systeminformation";
|
|
std::string destPath = cwd + "/__cmake_systeminformation";
|
|
|
cmSystemTools::RemoveADirectory(destPath);
|
|
cmSystemTools::RemoveADirectory(destPath);
|
|
|
if (!cmSystemTools::MakeDirectory(destPath)) {
|
|
if (!cmSystemTools::MakeDirectory(destPath)) {
|
|
@@ -3606,8 +3580,8 @@ int cmake::Build(int jobs, std::string dir, std::vector<std::string> targets,
|
|
|
|
|
|
|
|
#if !defined(CMAKE_BOOTSTRAP)
|
|
#if !defined(CMAKE_BOOTSTRAP)
|
|
|
if (!presetName.empty() || listPresets) {
|
|
if (!presetName.empty() || listPresets) {
|
|
|
- this->SetHomeDirectory(cmSystemTools::GetCurrentWorkingDirectory());
|
|
|
|
|
- this->SetHomeOutputDirectory(cmSystemTools::GetCurrentWorkingDirectory());
|
|
|
|
|
|
|
+ this->SetHomeDirectory(cmSystemTools::GetLogicalWorkingDirectory());
|
|
|
|
|
+ this->SetHomeOutputDirectory(cmSystemTools::GetLogicalWorkingDirectory());
|
|
|
|
|
|
|
|
cmCMakePresetsGraph settingsFile;
|
|
cmCMakePresetsGraph settingsFile;
|
|
|
auto result = settingsFile.ReadProjectPresets(this->GetHomeDirectory());
|
|
auto result = settingsFile.ReadProjectPresets(this->GetHomeDirectory());
|
|
@@ -3952,8 +3926,8 @@ int cmake::Workflow(const std::string& presetName,
|
|
|
WorkflowListPresets listPresets, WorkflowFresh fresh)
|
|
WorkflowListPresets listPresets, WorkflowFresh fresh)
|
|
|
{
|
|
{
|
|
|
#ifndef CMAKE_BOOTSTRAP
|
|
#ifndef CMAKE_BOOTSTRAP
|
|
|
- this->SetHomeDirectory(cmSystemTools::GetCurrentWorkingDirectory());
|
|
|
|
|
- this->SetHomeOutputDirectory(cmSystemTools::GetCurrentWorkingDirectory());
|
|
|
|
|
|
|
+ this->SetHomeDirectory(cmSystemTools::GetLogicalWorkingDirectory());
|
|
|
|
|
+ this->SetHomeOutputDirectory(cmSystemTools::GetLogicalWorkingDirectory());
|
|
|
|
|
|
|
|
cmCMakePresetsGraph settingsFile;
|
|
cmCMakePresetsGraph settingsFile;
|
|
|
auto result = settingsFile.ReadProjectPresets(this->GetHomeDirectory());
|
|
auto result = settingsFile.ReadProjectPresets(this->GetHomeDirectory());
|