[Cmake-commits] CMake branch, next, updated. v3.2.2-2563-g52d911c
Stephen Kelly
steveire at gmail.com
Tue May 5 17:25:18 EDT 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 52d911c79caa96c0a08bf138c2df2dcfd477f388 (commit)
via d63d21bcc422504ad8a783da8d681370f7c3fc28 (commit)
via f963ecf516a5bcbb0350023e32dad672018f549a (commit)
via 5fb6ec642b9b40735405ca5382609521815bb9b0 (commit)
via 3b884afa00e188b449d46d63b694296fc18c4117 (commit)
from 6d2f594648726880be490c95dba19167d0776182 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=52d911c79caa96c0a08bf138c2df2dcfd477f388
commit 52d911c79caa96c0a08bf138c2df2dcfd477f388
Merge: 6d2f594 d63d21b
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue May 5 17:25:17 2015 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue May 5 17:25:17 2015 -0400
Merge topic 'refactor-cmLocalGenerator' into next
d63d21bc cmState: Store computed relative paths to to current directories.
f963ecf5 cmState::Snapshot: Store components for current directories.
5fb6ec64 cmState: Compute and store directory components.
3b884afa cmGlobalGenerator: Move some flags from cmLocalGenerator.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d63d21bcc422504ad8a783da8d681370f7c3fc28
commit d63d21bcc422504ad8a783da8d681370f7c3fc28
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon May 4 23:30:29 2015 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue May 5 23:24:51 2015 +0200
cmState: Store computed relative paths to to current directories.
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index f64cb2d..a5f603f 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -66,7 +66,6 @@ cmLocalGenerator::cmLocalGenerator(cmGlobalGenerator* gg,
this->UseRelativePaths = false;
this->Configured = false;
this->EmitUniversalBinaryFlags = true;
- this->RelativePathsConfigured = false;
this->BackwardsCompatibility = 0;
this->BackwardsCompatibilityFinal = false;
}
@@ -2812,97 +2811,6 @@ std::string cmLocalGenerator::Convert(RelativeRoot remote,
}
//----------------------------------------------------------------------------
-std::string cmLocalGenerator::FindRelativePathTopSource()
-{
- cmState::Snapshot snapshot = this->StateSnapshot;
- std::vector<cmState::Snapshot> snapshots;
- snapshots.push_back(snapshot);
- while (true)
- {
- snapshot = snapshot.GetParent();
- if (snapshot.IsValid())
- {
- snapshots.push_back(snapshot);
- }
- else
- {
- break;
- }
- }
-
- std::string result = snapshots.front().GetCurrentSourceDirectory();
-
- for (std::vector<cmState::Snapshot>::const_iterator it =
- snapshots.begin() + 1; it != snapshots.end(); ++it)
- {
- std::string currentSource = it->GetCurrentSourceDirectory();
- if(cmSystemTools::IsSubDirectory(result, currentSource))
- {
- result = currentSource;
- }
- }
-
- return result;
-}
-
-//----------------------------------------------------------------------------
-std::string cmLocalGenerator::FindRelativePathTopBinary()
-{
- cmState::Snapshot snapshot = this->StateSnapshot;
- std::vector<cmState::Snapshot> snapshots;
- snapshots.push_back(snapshot);
- while (true)
- {
- snapshot = snapshot.GetParent();
- if (snapshot.IsValid())
- {
- snapshots.push_back(snapshot);
- }
- else
- {
- break;
- }
- }
-
- std::string result = snapshots.front().GetCurrentBinaryDirectory();
-
- for (std::vector<cmState::Snapshot>::const_iterator it =
- snapshots.begin() + 1; it != snapshots.end(); ++it)
- {
- std::string currentBinary = it->GetCurrentBinaryDirectory();
- if(cmSystemTools::IsSubDirectory(result, currentBinary))
- {
- result = currentBinary;
- }
- }
-
- return result;
-}
-
-//----------------------------------------------------------------------------
-void cmLocalGenerator::ConfigureRelativePaths()
-{
- // Relative path conversion inside the source tree is not used to
- // construct relative paths passed to build tools so it is safe to
- // even when the source is a network path.
- std::string source = this->FindRelativePathTopSource();
- this->RelativePathTopSource = source;
-
- // The current working directory on Windows cannot be a network
- // path. Therefore relative paths cannot work when the binary tree
- // is a network path.
- std::string binary = this->FindRelativePathTopBinary();
- if(binary.size() < 2 || binary.substr(0, 2) != "//")
- {
- this->RelativePathTopBinary = binary;
- }
- else
- {
- this->RelativePathTopBinary = "";
- }
-}
-
-//----------------------------------------------------------------------------
static bool cmLocalGeneratorNotAbove(const char* a, const char* b)
{
return (cmSystemTools::ComparePath(a, b) ||
@@ -2927,26 +2835,19 @@ cmLocalGenerator::ConvertToRelativePath(const std::vector<std::string>& local,
return in_remote;
}
- // Make sure relative path conversion is configured.
- if(!this->RelativePathsConfigured)
- {
- this->ConfigureRelativePaths();
- this->RelativePathsConfigured = true;
- }
-
if(!force)
{
// Skip conversion if the path and local are not both in the source
// or both in the binary tree.
std::string local_path = cmSystemTools::JoinPath(local);
if(!((cmLocalGeneratorNotAbove(local_path.c_str(),
- this->RelativePathTopBinary.c_str()) &&
+ this->StateSnapshot.GetRelativePathTopBinary()) &&
cmLocalGeneratorNotAbove(in_remote.c_str(),
- this->RelativePathTopBinary.c_str())) ||
+ this->StateSnapshot.GetRelativePathTopBinary())) ||
(cmLocalGeneratorNotAbove(local_path.c_str(),
- this->RelativePathTopSource.c_str()) &&
+ this->StateSnapshot.GetRelativePathTopSource()) &&
cmLocalGeneratorNotAbove(in_remote.c_str(),
- this->RelativePathTopSource.c_str()))))
+ this->StateSnapshot.GetRelativePathTopSource()))))
{
return in_remote;
}
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index bf447e5..c0da4f6 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -435,10 +435,6 @@ protected:
std::string const& dir_max);
void ComputeObjectMaxPath();
- void ConfigureRelativePaths();
- std::string FindRelativePathTopSource();
- std::string FindRelativePathTopBinary();
-
virtual std::string ConvertToLinkReference(std::string const& lib,
OutputFormat format = SHELL);
@@ -468,15 +464,6 @@ protected:
// committed.
std::string TargetImplib;
- // The top-most directories for relative path conversion. Both the
- // source and destination location of a relative path conversion
- // must be underneath one of these directories (both under source or
- // both under binary) in order for the relative path to be evaluated
- // safely by the build tools.
- std::string RelativePathTopSource;
- std::string RelativePathTopBinary;
- bool RelativePathsConfigured;
-
cmIML_INT_uint64_t BackwardsCompatibility;
bool BackwardsCompatibilityFinal;
private:
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index f11c79e..54bff7f 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -545,9 +545,11 @@ void cmLocalUnixMakefileGenerator3::WriteDirectoryInformationFile()
// Setup relative path conversion tops.
infoFileStream
<< "# Relative path conversion top directories.\n"
- << "set(CMAKE_RELATIVE_PATH_TOP_SOURCE \"" << this->RelativePathTopSource
+ << "set(CMAKE_RELATIVE_PATH_TOP_SOURCE \""
+ << this->StateSnapshot.GetRelativePathTopSource()
<< "\")\n"
- << "set(CMAKE_RELATIVE_PATH_TOP_BINARY \"" << this->RelativePathTopBinary
+ << "set(CMAKE_RELATIVE_PATH_TOP_BINARY \""
+ << this->StateSnapshot.GetRelativePathTopBinary()
<< "\")\n"
<< "\n";
@@ -1613,16 +1615,15 @@ cmLocalUnixMakefileGenerator3
}
// Setup relative path top directories.
- this->RelativePathsConfigured = true;
if(const char* relativePathTopSource =
mf->GetDefinition("CMAKE_RELATIVE_PATH_TOP_SOURCE"))
{
- this->RelativePathTopSource = relativePathTopSource;
+ this->StateSnapshot.SetRelativePathTopSource(relativePathTopSource);
}
if(const char* relativePathTopBinary =
mf->GetDefinition("CMAKE_RELATIVE_PATH_TOP_BINARY"))
{
- this->RelativePathTopBinary = relativePathTopBinary;
+ this->StateSnapshot.SetRelativePathTopBinary(relativePathTopBinary);
}
}
else
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index 219bd0c..7a1c715 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -199,6 +199,8 @@ void cmState::Initialize()
this->ParentPositions.clear();
this->CurrentSourceDirectoryComponents.clear();
this->CurrentBinaryDirectoryComponents.clear();
+ this->RelativePathTopSource.clear();
+ this->RelativePathTopBinary.clear();
this->CreateSnapshot(Snapshot());
this->DefineProperty
@@ -496,6 +498,86 @@ std::vector<std::string> const& cmState::GetBinaryDirectoryComponents() const
return this->BinaryDirectoryComponents;
}
+void cmState::Snapshot::ComputeRelativePathTopSource()
+{
+ // Relative path conversion inside the source tree is not used to
+ // construct relative paths passed to build tools so it is safe to use
+ // even when the source is a network path.
+
+ cmState::Snapshot snapshot = *this;
+ std::vector<cmState::Snapshot> snapshots;
+ snapshots.push_back(snapshot);
+ while (true)
+ {
+ snapshot = snapshot.GetParent();
+ if (snapshot.IsValid())
+ {
+ snapshots.push_back(snapshot);
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ std::string result = snapshots.front().GetCurrentSourceDirectory();
+
+ for (std::vector<cmState::Snapshot>::const_iterator it =
+ snapshots.begin() + 1; it != snapshots.end(); ++it)
+ {
+ std::string currentSource = it->GetCurrentSourceDirectory();
+ if(cmSystemTools::IsSubDirectory(result, currentSource))
+ {
+ result = currentSource;
+ }
+ }
+ this->State->RelativePathTopSource[this->Position] = result;
+}
+
+void cmState::Snapshot::ComputeRelativePathTopBinary()
+{
+ cmState::Snapshot snapshot = *this;
+ std::vector<cmState::Snapshot> snapshots;
+ snapshots.push_back(snapshot);
+ while (true)
+ {
+ snapshot = snapshot.GetParent();
+ if (snapshot.IsValid())
+ {
+ snapshots.push_back(snapshot);
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ std::string result =
+ snapshots.front().GetCurrentBinaryDirectory();
+
+ for (std::vector<cmState::Snapshot>::const_iterator it =
+ snapshots.begin() + 1; it != snapshots.end(); ++it)
+ {
+ std::string currentBinary = it->GetCurrentBinaryDirectory();
+ if(cmSystemTools::IsSubDirectory(result, currentBinary))
+ {
+ result = currentBinary;
+ }
+ }
+
+ // The current working directory on Windows cannot be a network
+ // path. Therefore relative paths cannot work when the binary tree
+ // is a network path.
+ if(result.size() < 2 || result.substr(0, 2) != "//")
+ {
+ this->State->RelativePathTopBinary[this->Position] = result;
+ }
+ else
+ {
+ this->State->RelativePathTopBinary[this->Position] = "";
+ }
+}
+
cmState::Snapshot cmState::CreateSnapshot(Snapshot originSnapshot)
{
PositionType pos = this->ParentPositions.size();
@@ -506,6 +588,8 @@ cmState::Snapshot cmState::CreateSnapshot(Snapshot originSnapshot)
this->CurrentSourceDirectoryComponents.size() + 1);
this->CurrentBinaryDirectoryComponents.resize(
this->CurrentBinaryDirectoryComponents.size() + 1);
+ this->RelativePathTopSource.resize(this->RelativePathTopSource.size() + 1);
+ this->RelativePathTopBinary.resize(this->RelativePathTopBinary.size() + 1);
return cmState::Snapshot(this, pos);
}
@@ -533,6 +617,7 @@ void cmState::Snapshot::SetCurrentSourceDirectory(std::string const& dir)
cmSystemTools::SplitPath(
this->State->Locations[this->Position],
this->State->CurrentSourceDirectoryComponents[this->Position]);
+ this->ComputeRelativePathTopSource();
}
const char* cmState::Snapshot::GetCurrentBinaryDirectory() const
@@ -553,6 +638,7 @@ void cmState::Snapshot::SetCurrentBinaryDirectory(std::string const& dir)
cmSystemTools::SplitPath(
this->State->OutputLocations[this->Position],
this->State->CurrentBinaryDirectoryComponents[this->Position]);
+ this->ComputeRelativePathTopBinary();
}
std::vector<std::string> const&
@@ -567,6 +653,26 @@ cmState::Snapshot::GetCurrentBinaryDirectoryComponents()
return this->State->CurrentBinaryDirectoryComponents[this->Position];
}
+const char* cmState::Snapshot::GetRelativePathTopSource() const
+{
+ return this->State->RelativePathTopSource[this->Position].c_str();
+}
+
+const char* cmState::Snapshot::GetRelativePathTopBinary() const
+{
+ return this->State->RelativePathTopBinary[this->Position].c_str();
+}
+
+void cmState::Snapshot::SetRelativePathTopSource(const char* dir)
+{
+ this->State->RelativePathTopSource[this->Position] = dir;
+}
+
+void cmState::Snapshot::SetRelativePathTopBinary(const char* dir)
+{
+ this->State->RelativePathTopBinary[this->Position] = dir;
+}
+
bool cmState::Snapshot::IsValid() const
{
return this->State;
diff --git a/Source/cmState.h b/Source/cmState.h
index faf0739..23d3f0d 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -39,10 +39,19 @@ public:
std::vector<std::string> const& GetCurrentSourceDirectoryComponents();
std::vector<std::string> const& GetCurrentBinaryDirectoryComponents();
+ const char* GetRelativePathTopSource() const;
+ const char* GetRelativePathTopBinary() const;
+ void SetRelativePathTopSource(const char* dir);
+ void SetRelativePathTopBinary(const char* dir);
+
bool IsValid() const;
Snapshot GetParent() const;
private:
+ void ComputeRelativePathTopSource();
+ void ComputeRelativePathTopBinary();
+
+ private:
friend class cmState;
cmState* State;
cmState::PositionType Position;
@@ -141,6 +150,13 @@ private:
std::vector<std::vector<std::string> > CurrentSourceDirectoryComponents;
std::vector<std::vector<std::string> > CurrentBinaryDirectoryComponents;
+ // The top-most directories for relative path conversion. Both the
+ // source and destination location of a relative path conversion
+ // must be underneath one of these directories (both under source or
+ // both under binary) in order for the relative path to be evaluated
+ // safely by the build tools.
+ std::vector<std::string> RelativePathTopSource;
+ std::vector<std::string> RelativePathTopBinary;
std::vector<std::string> SourceDirectoryComponents;
std::vector<std::string> BinaryDirectoryComponents;
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f963ecf516a5bcbb0350023e32dad672018f549a
commit f963ecf516a5bcbb0350023e32dad672018f549a
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon May 4 23:08:19 2015 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue May 5 23:24:51 2015 +0200
cmState::Snapshot: Store components for current directories.
Remove this responsibility from cmLocalGenerator.
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 0a955bb..f64cb2d 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -67,7 +67,6 @@ cmLocalGenerator::cmLocalGenerator(cmGlobalGenerator* gg,
this->Configured = false;
this->EmitUniversalBinaryFlags = true;
this->RelativePathsConfigured = false;
- this->PathConversionsSetup = false;
this->BackwardsCompatibility = 0;
this->BackwardsCompatibilityFinal = false;
}
@@ -229,22 +228,6 @@ void cmLocalGenerator::ReadInputFile()
}
}
-void cmLocalGenerator::SetupPathConversions()
-{
- // Setup the current output directory components for use by
- // Convert
- std::string outdir;
-
- outdir = cmSystemTools::CollapseFullPath(
- this->StateSnapshot.GetCurrentSourceDirectory());
- cmSystemTools::SplitPath(outdir, this->StartDirectoryComponents);
-
- outdir = cmSystemTools::CollapseFullPath
- (this->StateSnapshot.GetCurrentBinaryDirectory());
- cmSystemTools::SplitPath(outdir,
- this->StartOutputDirectoryComponents);
-}
-
void cmLocalGenerator::ConfigureFinalPass()
{
this->Makefile->ConfigureFinalPass();
@@ -2731,13 +2714,6 @@ std::string cmLocalGenerator::Convert(const std::string& source,
OutputFormat output,
bool optional)
{
- // Make sure the relative path conversion components are set.
- if(!this->PathConversionsSetup)
- {
- this->SetupPathConversions();
- this->PathConversionsSetup = true;
- }
-
// Convert the path to a relative path.
std::string result = source;
@@ -2752,20 +2728,18 @@ std::string cmLocalGenerator::Convert(const std::string& source,
break;
case START:
//result = cmSystemTools::CollapseFullPath(result.c_str());
- result = this->ConvertToRelativePath(this->StartDirectoryComponents,
- result);
+ result = this->ConvertToRelativePath(
+ this->StateSnapshot.GetCurrentSourceDirectoryComponents(), result);
break;
case HOME_OUTPUT:
//result = cmSystemTools::CollapseFullPath(result.c_str());
- result =
- this->ConvertToRelativePath(
- this->GetState()->GetBinaryDirectoryComponents(), result);
+ result = this->ConvertToRelativePath(
+ this->GetState()->GetBinaryDirectoryComponents(), result);
break;
case START_OUTPUT:
//result = cmSystemTools::CollapseFullPath(result.c_str());
- result =
- this->ConvertToRelativePath(this->StartOutputDirectoryComponents,
- result);
+ result = this->ConvertToRelativePath(
+ this->StateSnapshot.GetCurrentBinaryDirectoryComponents(), result);
break;
case FULL:
result = cmSystemTools::CollapseFullPath(result);
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 5cdf161..bf447e5 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -438,7 +438,6 @@ protected:
void ConfigureRelativePaths();
std::string FindRelativePathTopSource();
std::string FindRelativePathTopBinary();
- void SetupPathConversions();
virtual std::string ConvertToLinkReference(std::string const& lib,
OutputFormat format = SHELL);
@@ -453,8 +452,6 @@ protected:
cmMakefile *Makefile;
cmState::Snapshot StateSnapshot;
cmGlobalGenerator *GlobalGenerator;
- std::vector<std::string> StartDirectoryComponents;
- std::vector<std::string> StartOutputDirectoryComponents;
cmLocalGenerator* Parent;
std::vector<cmLocalGenerator*> Children;
std::map<std::string, std::string> UniqueObjectNamesMap;
@@ -479,7 +476,6 @@ protected:
std::string RelativePathTopSource;
std::string RelativePathTopBinary;
bool RelativePathsConfigured;
- bool PathConversionsSetup;
cmIML_INT_uint64_t BackwardsCompatibility;
bool BackwardsCompatibilityFinal;
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index c5b12d9..219bd0c 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -197,6 +197,8 @@ void cmState::Initialize()
this->Locations.clear();
this->OutputLocations.clear();
this->ParentPositions.clear();
+ this->CurrentSourceDirectoryComponents.clear();
+ this->CurrentBinaryDirectoryComponents.clear();
this->CreateSnapshot(Snapshot());
this->DefineProperty
@@ -500,6 +502,10 @@ cmState::Snapshot cmState::CreateSnapshot(Snapshot originSnapshot)
this->ParentPositions.push_back(originSnapshot.Position);
this->Locations.resize(this->Locations.size() + 1);
this->OutputLocations.resize(this->OutputLocations.size() + 1);
+ this->CurrentSourceDirectoryComponents.resize(
+ this->CurrentSourceDirectoryComponents.size() + 1);
+ this->CurrentBinaryDirectoryComponents.resize(
+ this->CurrentBinaryDirectoryComponents.size() + 1);
return cmState::Snapshot(this, pos);
}
@@ -523,6 +529,10 @@ void cmState::Snapshot::SetCurrentSourceDirectory(std::string const& dir)
this->State->Locations[this->Position]);
this->State->Locations[this->Position] =
cmSystemTools::CollapseFullPath(this->State->Locations[this->Position]);
+
+ cmSystemTools::SplitPath(
+ this->State->Locations[this->Position],
+ this->State->CurrentSourceDirectoryComponents[this->Position]);
}
const char* cmState::Snapshot::GetCurrentBinaryDirectory() const
@@ -539,6 +549,22 @@ void cmState::Snapshot::SetCurrentBinaryDirectory(std::string const& dir)
this->State->OutputLocations[this->Position] =
cmSystemTools::CollapseFullPath(
this->State->OutputLocations[this->Position]);
+
+ cmSystemTools::SplitPath(
+ this->State->OutputLocations[this->Position],
+ this->State->CurrentBinaryDirectoryComponents[this->Position]);
+}
+
+std::vector<std::string> const&
+cmState::Snapshot::GetCurrentSourceDirectoryComponents()
+{
+ return this->State->CurrentSourceDirectoryComponents[this->Position];
+}
+
+std::vector<std::string> const&
+cmState::Snapshot::GetCurrentBinaryDirectoryComponents()
+{
+ return this->State->CurrentBinaryDirectoryComponents[this->Position];
}
bool cmState::Snapshot::IsValid() const
diff --git a/Source/cmState.h b/Source/cmState.h
index 956b4f4..faf0739 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -36,6 +36,9 @@ public:
const char* GetCurrentBinaryDirectory() const;
void SetCurrentBinaryDirectory(std::string const& dir);
+ std::vector<std::string> const& GetCurrentSourceDirectoryComponents();
+ std::vector<std::string> const& GetCurrentBinaryDirectoryComponents();
+
bool IsValid() const;
Snapshot GetParent() const;
@@ -136,6 +139,9 @@ private:
std::vector<std::string> OutputLocations;
std::vector<PositionType> ParentPositions;
+ std::vector<std::vector<std::string> > CurrentSourceDirectoryComponents;
+ std::vector<std::vector<std::string> > CurrentBinaryDirectoryComponents;
+
std::vector<std::string> SourceDirectoryComponents;
std::vector<std::string> BinaryDirectoryComponents;
std::string SourceDirectory;
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5fb6ec642b9b40735405ca5382609521815bb9b0
commit 5fb6ec642b9b40735405ca5382609521815bb9b0
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon May 4 23:01:29 2015 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue May 5 23:24:51 2015 +0200
cmState: Compute and store directory components.
There is no need to duplicate these in all cmLocalGenerators.
Rename the symbols according to current conventions.
Add explicit calls to Set{Source,Binary}Directory with empty strings
in order to trigger the population of the components containers with
the current working directory in cmLocalGenerator. Having
directories set to empty is a special case in CMake, which is relied
on for the `if(CMAKE_BINARY_DIR)` condition at the end of
CMakeDetermineSystem.cmake.
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 2207873..d08b5de 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -198,6 +198,8 @@ int main (int argc, char const* const* argv)
"Read CPack config file: " << cpackConfigFile << std::endl);
cmake cminst;
+ cminst.SetHomeDirectory("");
+ cminst.SetHomeOutputDirectory("");
cminst.GetState()->RemoveUnscriptableCommands();
cmGlobalGenerator cmgg;
cmgg.SetCMakeInstance(&cminst);
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx
index 586070b..20d303d 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.cxx
+++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx
@@ -204,6 +204,8 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
}
cmake cm;
+ cm.SetHomeDirectory("");
+ cm.SetHomeOutputDirectory("");
std::string cmakeOutString;
cmCTestBuildAndTestCaptureRAII captureRAII(cm, cmakeOutString);
static_cast<void>(captureRAII);
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 0a34be8..322855a 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -336,6 +336,8 @@ void cmCTestScriptHandler::CreateCMake()
delete this->LocalGenerator;
}
this->CMake = new cmake;
+ this->CMake->SetHomeDirectory("");
+ this->CMake->SetHomeOutputDirectory("");
this->CMake->AddCMakePaths();
this->GlobalGenerator = new cmGlobalGenerator;
this->GlobalGenerator->SetCMakeInstance(this->CMake);
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index bd6af8c..0a955bb 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -234,19 +234,12 @@ void cmLocalGenerator::SetupPathConversions()
// Setup the current output directory components for use by
// Convert
std::string outdir;
- outdir =
- cmSystemTools::CollapseFullPath(this->GetState()->GetSourceDirectory());
- cmSystemTools::SplitPath(outdir, this->HomeDirectoryComponents);
+
outdir = cmSystemTools::CollapseFullPath(
this->StateSnapshot.GetCurrentSourceDirectory());
cmSystemTools::SplitPath(outdir, this->StartDirectoryComponents);
outdir = cmSystemTools::CollapseFullPath
- (this->GetState()->GetBinaryDirectory());
- cmSystemTools::SplitPath(outdir,
- this->HomeOutputDirectoryComponents);
-
- outdir = cmSystemTools::CollapseFullPath
(this->StateSnapshot.GetCurrentBinaryDirectory());
cmSystemTools::SplitPath(outdir,
this->StartOutputDirectoryComponents);
@@ -2754,8 +2747,8 @@ std::string cmLocalGenerator::Convert(const std::string& source,
{
case HOME:
//result = cmSystemTools::CollapseFullPath(result.c_str());
- result = this->ConvertToRelativePath(this->HomeDirectoryComponents,
- result);
+ result = this->ConvertToRelativePath(
+ this->GetState()->GetSourceDirectoryComponents(), result);
break;
case START:
//result = cmSystemTools::CollapseFullPath(result.c_str());
@@ -2765,8 +2758,8 @@ std::string cmLocalGenerator::Convert(const std::string& source,
case HOME_OUTPUT:
//result = cmSystemTools::CollapseFullPath(result.c_str());
result =
- this->ConvertToRelativePath(this->HomeOutputDirectoryComponents,
- result);
+ this->ConvertToRelativePath(
+ this->GetState()->GetBinaryDirectoryComponents(), result);
break;
case START_OUTPUT:
//result = cmSystemTools::CollapseFullPath(result.c_str());
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 47c0877..5cdf161 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -453,9 +453,7 @@ protected:
cmMakefile *Makefile;
cmState::Snapshot StateSnapshot;
cmGlobalGenerator *GlobalGenerator;
- std::vector<std::string> HomeDirectoryComponents;
std::vector<std::string> StartDirectoryComponents;
- std::vector<std::string> HomeOutputDirectoryComponents;
std::vector<std::string> StartOutputDirectoryComponents;
cmLocalGenerator* Parent;
std::vector<cmLocalGenerator*> Children;
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index 3cca3a7..c5b12d9 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -458,6 +458,10 @@ void cmState::SetSourceDirectory(std::string const& sourceDirectory)
{
this->SourceDirectory = sourceDirectory;
cmSystemTools::ConvertToUnixSlashes(this->SourceDirectory);
+
+ cmSystemTools::SplitPath(
+ cmSystemTools::CollapseFullPath(this->SourceDirectory),
+ this->SourceDirectoryComponents);
}
const char* cmState::GetSourceDirectory() const
@@ -465,10 +469,19 @@ const char* cmState::GetSourceDirectory() const
return this->SourceDirectory.c_str();
}
+std::vector<std::string> const& cmState::GetSourceDirectoryComponents() const
+{
+ return this->SourceDirectoryComponents;
+}
+
void cmState::SetBinaryDirectory(std::string const& binaryDirectory)
{
this->BinaryDirectory = binaryDirectory;
cmSystemTools::ConvertToUnixSlashes(this->BinaryDirectory);
+
+ cmSystemTools::SplitPath(
+ cmSystemTools::CollapseFullPath(this->BinaryDirectory),
+ this->BinaryDirectoryComponents);
}
const char* cmState::GetBinaryDirectory() const
@@ -476,6 +489,11 @@ const char* cmState::GetBinaryDirectory() const
return this->BinaryDirectory.c_str();
}
+std::vector<std::string> const& cmState::GetBinaryDirectoryComponents() const
+{
+ return this->BinaryDirectoryComponents;
+}
+
cmState::Snapshot cmState::CreateSnapshot(Snapshot originSnapshot)
{
PositionType pos = this->ParentPositions.size();
diff --git a/Source/cmState.h b/Source/cmState.h
index ed58c64..956b4f4 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -123,6 +123,9 @@ public:
const char* GetBinaryDirectory() const;
void SetBinaryDirectory(std::string const& binaryDirectory);
+ std::vector<std::string> const& GetSourceDirectoryComponents() const;
+ std::vector<std::string> const& GetBinaryDirectoryComponents() const;
+
private:
std::map<cmProperty::ScopeType, cmPropertyDefinitionMap> PropertyDefinitions;
std::vector<std::string> EnabledLanguages;
@@ -132,6 +135,9 @@ private:
std::vector<std::string> Locations;
std::vector<std::string> OutputLocations;
std::vector<PositionType> ParentPositions;
+
+ std::vector<std::string> SourceDirectoryComponents;
+ std::vector<std::string> BinaryDirectoryComponents;
std::string SourceDirectory;
std::string BinaryDirectory;
bool IsInTryCompile;
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 5c5c428..2f9789d 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2580,6 +2580,9 @@ int cmake::Build(const std::string& dir,
const std::vector<std::string>& nativeOptions,
bool clean)
{
+
+ this->SetHomeDirectory("");
+ this->SetHomeOutputDirectory("");
if(!cmSystemTools::FileIsDirectory(dir))
{
std::cerr << "Error: " << dir << " is not a directory\n";
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3b884afa00e188b449d46d63b694296fc18c4117
commit 3b884afa00e188b449d46d63b694296fc18c4117
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon May 4 22:40:11 2015 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue May 5 23:24:51 2015 +0200
cmGlobalGenerator: Move some flags from cmLocalGenerator.
These flags are global, and so they belong here instead of being
set on each local generator.
diff --git a/Source/cmGlobalBorlandMakefileGenerator.cxx b/Source/cmGlobalBorlandMakefileGenerator.cxx
index 0220799..d191056 100644
--- a/Source/cmGlobalBorlandMakefileGenerator.cxx
+++ b/Source/cmGlobalBorlandMakefileGenerator.cxx
@@ -21,6 +21,7 @@ cmGlobalBorlandMakefileGenerator::cmGlobalBorlandMakefileGenerator()
this->ForceUnixPaths = false;
this->ToolSupportsColor = true;
this->UseLinkScript = false;
+ this->WindowsShell = true;
}
@@ -43,7 +44,6 @@ cmLocalGenerator *cmGlobalBorlandMakefileGenerator::CreateLocalGenerator(
cmLocalUnixMakefileGenerator3* lg =
new cmLocalUnixMakefileGenerator3(this, parent);
lg->SetIncludeDirective("!include");
- lg->SetWindowsShell(true);
lg->SetDefineWindowsNULL(true);
lg->SetMakefileVariableSize(32);
lg->SetPassMakeflags(true);
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 7117402..fe73e8c 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -71,6 +71,13 @@ cmGlobalGenerator::cmGlobalGenerator()
this->ExtraGenerator = 0;
this->CurrentLocalGenerator = 0;
this->TryCompileOuterMakefile = 0;
+
+ this->WindowsShell = false;
+ this->WindowsVSIDE = false;
+ this->WatcomWMake = false;
+ this->MinGWMake = false;
+ this->NMake = false;
+ this->MSYSShell = false;
}
cmGlobalGenerator::~cmGlobalGenerator()
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 7107198..3b321f2 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -354,6 +354,13 @@ public:
cmFileLockPool& GetFileLockPool() { return FileLockPool; }
#endif
+ bool WindowsShell;
+ bool WindowsVSIDE;
+ bool WatcomWMake;
+ bool MinGWMake;
+ bool NMake;
+ bool MSYSShell;
+
protected:
virtual void Generate();
diff --git a/Source/cmGlobalJOMMakefileGenerator.cxx b/Source/cmGlobalJOMMakefileGenerator.cxx
index 1caa730..25613eb 100644
--- a/Source/cmGlobalJOMMakefileGenerator.cxx
+++ b/Source/cmGlobalJOMMakefileGenerator.cxx
@@ -19,6 +19,8 @@ cmGlobalJOMMakefileGenerator::cmGlobalJOMMakefileGenerator()
this->ForceUnixPaths = false;
this->ToolSupportsColor = true;
this->UseLinkScript = false;
+ this->WindowsShell = true;
+ this->NMake = true;
}
void cmGlobalJOMMakefileGenerator
@@ -51,11 +53,9 @@ cmGlobalJOMMakefileGenerator::CreateLocalGenerator(cmLocalGenerator* parent)
cmLocalUnixMakefileGenerator3* lg
= new cmLocalUnixMakefileGenerator3(this, parent);
lg->SetDefineWindowsNULL(true);
- lg->SetWindowsShell(true);
lg->SetMakeSilentFlag("/nologo");
lg->SetIgnoreLibPrefix(true);
lg->SetPassMakeflags(true);
- lg->SetNMake(true);
lg->SetUnixCD(false);
return lg;
}
diff --git a/Source/cmGlobalMSYSMakefileGenerator.cxx b/Source/cmGlobalMSYSMakefileGenerator.cxx
index 319eeaf..b6adcbb 100644
--- a/Source/cmGlobalMSYSMakefileGenerator.cxx
+++ b/Source/cmGlobalMSYSMakefileGenerator.cxx
@@ -21,6 +21,7 @@ cmGlobalMSYSMakefileGenerator::cmGlobalMSYSMakefileGenerator()
this->ForceUnixPaths = true;
this->ToolSupportsColor = true;
this->UseLinkScript = false;
+ this->MSYSShell = true;
}
std::string
@@ -98,8 +99,6 @@ cmGlobalMSYSMakefileGenerator::CreateLocalGenerator(cmLocalGenerator* parent)
{
cmLocalUnixMakefileGenerator3* lg =
new cmLocalUnixMakefileGenerator3(this, parent);
- lg->SetWindowsShell(false);
- lg->SetMSYSShell(true);
lg->SetIgnoreLibPrefix(true);
lg->SetPassMakeflags(false);
lg->SetUnixCD(true);
diff --git a/Source/cmGlobalMinGWMakefileGenerator.cxx b/Source/cmGlobalMinGWMakefileGenerator.cxx
index c4511e5..ba0790d 100644
--- a/Source/cmGlobalMinGWMakefileGenerator.cxx
+++ b/Source/cmGlobalMinGWMakefileGenerator.cxx
@@ -19,6 +19,8 @@ cmGlobalMinGWMakefileGenerator::cmGlobalMinGWMakefileGenerator()
this->ForceUnixPaths = true;
this->ToolSupportsColor = true;
this->UseLinkScript = true;
+ this->WindowsShell = true;
+ this->MinGWMake = true;
}
void cmGlobalMinGWMakefileGenerator
@@ -36,11 +38,9 @@ cmGlobalMinGWMakefileGenerator::CreateLocalGenerator(cmLocalGenerator* parent)
{
cmLocalUnixMakefileGenerator3* lg =
new cmLocalUnixMakefileGenerator3(this, parent);
- lg->SetWindowsShell(true);
lg->SetIgnoreLibPrefix(true);
lg->SetPassMakeflags(false);
lg->SetUnixCD(true);
- lg->SetMinGWMake(true);
return lg;
}
diff --git a/Source/cmGlobalNMakeMakefileGenerator.cxx b/Source/cmGlobalNMakeMakefileGenerator.cxx
index 2732e22..98d7fb4 100644
--- a/Source/cmGlobalNMakeMakefileGenerator.cxx
+++ b/Source/cmGlobalNMakeMakefileGenerator.cxx
@@ -19,6 +19,8 @@ cmGlobalNMakeMakefileGenerator::cmGlobalNMakeMakefileGenerator()
this->ForceUnixPaths = false;
this->ToolSupportsColor = true;
this->UseLinkScript = false;
+ this->WindowsShell = true;
+ this->NMake = true;
}
void cmGlobalNMakeMakefileGenerator
@@ -51,11 +53,9 @@ cmGlobalNMakeMakefileGenerator::CreateLocalGenerator(cmLocalGenerator* parent)
cmLocalUnixMakefileGenerator3* lg =
new cmLocalUnixMakefileGenerator3(this, parent);
lg->SetDefineWindowsNULL(true);
- lg->SetWindowsShell(true);
lg->SetMakeSilentFlag("/nologo");
lg->SetIgnoreLibPrefix(true);
lg->SetPassMakeflags(true);
- lg->SetNMake(true);
lg->SetUnixCD(false);
return lg;
}
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index dde9ca4..7a26cc0 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -487,6 +487,9 @@ cmGlobalNinjaGenerator::cmGlobalNinjaGenerator()
, ComputingUnknownDependencies(false)
, PolicyCMP0058(cmPolicies::WARN)
{
+#ifdef _WIN32
+ this->WindowsShell = true;
+#endif
// // Ninja is not ported to non-Unix OS yet.
// this->ForceUnixPaths = true;
this->FindMakeProgramFile = "CMakeNinjaFindMake.cmake";
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 60d545b..b74ba6f 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -23,6 +23,8 @@
//----------------------------------------------------------------------------
cmGlobalVisualStudioGenerator::cmGlobalVisualStudioGenerator()
{
+ this->WindowsShell = true;
+ this->WindowsVSIDE = true;
}
//----------------------------------------------------------------------------
diff --git a/Source/cmGlobalWatcomWMakeGenerator.cxx b/Source/cmGlobalWatcomWMakeGenerator.cxx
index 49c516f..181178f 100644
--- a/Source/cmGlobalWatcomWMakeGenerator.cxx
+++ b/Source/cmGlobalWatcomWMakeGenerator.cxx
@@ -22,6 +22,10 @@ cmGlobalWatcomWMakeGenerator::cmGlobalWatcomWMakeGenerator()
this->ToolSupportsColor = true;
this->NeedSymbolicMark = true;
this->EmptyRuleHackCommand = "@cd .";
+#ifdef _WIN32
+ this->WindowsShell = true;
+#endif
+ this->WatcomWMake = true;
}
void cmGlobalWatcomWMakeGenerator
@@ -47,10 +51,6 @@ cmGlobalWatcomWMakeGenerator::CreateLocalGenerator(cmLocalGenerator* parent)
cmLocalUnixMakefileGenerator3* lg
= new cmLocalUnixMakefileGenerator3(this, parent);
lg->SetDefineWindowsNULL(true);
-#ifdef _WIN32
- lg->SetWindowsShell(true);
-#endif
- lg->SetWatcomWMake(true);
lg->SetMakeSilentFlag("-h");
lg->SetIgnoreLibPrefix(true);
lg->SetPassMakeflags(false);
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 5ef0a3b..bd6af8c 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -61,12 +61,6 @@ cmLocalGenerator::cmLocalGenerator(cmGlobalGenerator* gg,
}
this->Makefile = new cmMakefile(this);
- this->WindowsShell = false;
- this->WindowsVSIDE = false;
- this->WatcomWMake = false;
- this->MinGWMake = false;
- this->NMake = false;
- this->MSYSShell = false;
this->LinkScriptShell = false;
this->IgnoreLibPrefix = false;
this->UseRelativePaths = false;
@@ -1254,7 +1248,7 @@ cmLocalGenerator::ConvertToOutputForExistingCommon(const std::string& remote,
// If this is a windows shell, the result has a space, and the path
// already exists, we can use a short-path to reference it without a
// space.
- if(this->WindowsShell && result.find(' ') != result.npos &&
+ if(this->GlobalGenerator->WindowsShell && result.find(' ') != result.npos &&
cmSystemTools::FileExists(remote.c_str()))
{
std::string tmp;
@@ -2626,7 +2620,7 @@ void cmLocalGenerator::JoinDefines(const std::set<std::string>& defines,
{
// Append the definition with proper escaping.
std::string def = dflag;
- if(this->WatcomWMake)
+ if(this->GlobalGenerator->WatcomWMake)
{
// The Watcom compiler does its own command line parsing instead
// of using the windows shell rules. Definitions are one of
@@ -2805,7 +2799,7 @@ std::string cmLocalGenerator::ConvertToOutputFormat(const std::string& source,
// For the MSYS shell convert drive letters to posix paths, so
// that c:/some/path becomes /c/some/path. This is needed to
// avoid problems with the shell path translation.
- if(this->MSYSShell && !this->LinkScriptShell)
+ if(this->GlobalGenerator->MSYSShell && !this->LinkScriptShell)
{
if(result.size() > 2 && result[1] == ':')
{
@@ -2813,7 +2807,7 @@ std::string cmLocalGenerator::ConvertToOutputFormat(const std::string& source,
result[0] = '/';
}
}
- if(this->WindowsShell)
+ if(this->GlobalGenerator->WindowsShell)
{
std::replace(result.begin(), result.end(), '/', '\\');
}
@@ -3324,6 +3318,26 @@ void cmLocalGenerator::ComputeObjectFilenames(
}
+bool cmLocalGenerator::IsWindowsShell() const
+{
+ return this->GlobalGenerator->WindowsShell;
+}
+
+bool cmLocalGenerator::IsWatcomWMake() const
+{
+ return this->GlobalGenerator->WatcomWMake;
+}
+
+bool cmLocalGenerator::IsMinGWMake() const
+{
+ return this->GlobalGenerator->MinGWMake;
+}
+
+bool cmLocalGenerator::IsNMake() const
+{
+ return this->GlobalGenerator->NMake;
+}
+
//----------------------------------------------------------------------------
std::string
cmLocalGenerator
@@ -3467,7 +3481,7 @@ std::string cmLocalGenerator::EscapeForShell(const std::string& str,
// Compute the flags for the target shell environment.
int flags = 0;
- if(this->WindowsVSIDE)
+ if(this->GlobalGenerator->WindowsVSIDE)
{
flags |= cmsysSystem_Shell_Flag_VSIDE;
}
@@ -3487,27 +3501,27 @@ std::string cmLocalGenerator::EscapeForShell(const std::string& str,
{
flags |= cmsysSystem_Shell_Flag_WatcomQuote;
}
- if(this->WatcomWMake)
+ if(this->GlobalGenerator->WatcomWMake)
{
flags |= cmsysSystem_Shell_Flag_WatcomWMake;
}
- if(this->MinGWMake)
+ if(this->GlobalGenerator->MinGWMake)
{
flags |= cmsysSystem_Shell_Flag_MinGWMake;
}
- if(this->NMake)
+ if(this->GlobalGenerator->NMake)
{
flags |= cmsysSystem_Shell_Flag_NMake;
}
// Compute the buffer size needed.
- int size = (this->WindowsShell ?
+ int size = (this->GlobalGenerator->WindowsShell ?
cmsysSystem_Shell_GetArgumentSizeForWindows(str.c_str(), flags) :
cmsysSystem_Shell_GetArgumentSizeForUnix(str.c_str(), flags));
// Compute the shell argument itself.
std::vector<char> arg(size);
- if(this->WindowsShell)
+ if(this->GlobalGenerator->WindowsShell)
{
cmsysSystem_Shell_GetArgumentForWindows(str.c_str(), &arg[0], flags);
}
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 100d27b..47c0877 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -383,6 +383,11 @@ public:
std::map<cmSourceFile const*, std::string>& mapping,
cmGeneratorTarget const* gt = 0);
+ bool IsWindowsShell() const;
+ bool IsWatcomWMake() const;
+ bool IsMinGWMake() const;
+ bool IsNMake() const;
+
protected:
///! put all the libraries for a target on into the given stream
virtual void OutputLinkLibraries(std::string& linkLibraries,
@@ -457,17 +462,13 @@ protected:
std::map<std::string, std::string> UniqueObjectNamesMap;
std::string::size_type ObjectPathMax;
std::set<std::string> ObjectMaxPathViolations;
- bool WindowsShell;
- bool WindowsVSIDE;
- bool WatcomWMake;
- bool MinGWMake;
- bool NMake;
- bool MSYSShell;
+
bool LinkScriptShell;
bool UseRelativePaths;
bool IgnoreLibPrefix;
bool Configured;
bool EmitUniversalBinaryFlags;
+
// Hack for ExpandRuleVariable until object-oriented version is
// committed.
std::string TargetImplib;
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index ac10f09..ded4c25 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -28,9 +28,6 @@ cmLocalNinjaGenerator::cmLocalNinjaGenerator(cmGlobalGenerator* gg,
, ConfigName("")
, HomeRelativeOutputPath("")
{
-#ifdef _WIN32
- this->WindowsShell = true;
-#endif
this->TargetImplib = "$TARGET_IMPLIB";
}
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index a2a3725..f11c79e 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -83,7 +83,6 @@ cmLocalUnixMakefileGenerator3::
cmLocalUnixMakefileGenerator3(cmGlobalGenerator* gg, cmLocalGenerator* parent)
: cmLocalGenerator(gg, parent)
{
- this->WindowsShell = false;
this->IncludeDirective = "include";
this->MakefileVariableSize = 0;
this->IgnoreLibPrefix = false;
@@ -679,7 +678,7 @@ cmLocalUnixMakefileGenerator3
// Write the list of commands.
os << cmWrap("\t", commands, "", "\n") << "\n";
- if(symbolic && !this->WatcomWMake)
+ if(symbolic && !this->IsWatcomWMake())
{
os << ".PHONY : " << cmMakeSafe(tgt) << "\n";
}
@@ -696,7 +695,7 @@ std::string
cmLocalUnixMakefileGenerator3
::ConvertShellCommand(std::string const& cmd, RelativeRoot root)
{
- if(this->WatcomWMake &&
+ if(this->IsWatcomWMake() &&
cmSystemTools::FileIsFullPath(cmd.c_str()) &&
cmd.find_first_of("( )") != cmd.npos)
{
@@ -730,7 +729,7 @@ cmLocalUnixMakefileGenerator3
<< "NULL=nul\n"
<< "!ENDIF\n";
}
- if(this->WindowsShell)
+ if(this->IsWindowsShell())
{
makefileStream
<< "SHELL = cmd.exe\n"
@@ -798,7 +797,8 @@ cmLocalUnixMakefileGenerator3
makefileStream, "Disable implicit rules so canonical targets will work.",
".SUFFIXES", no_depends, no_commands, false);
- if(!this->NMake && !this->WatcomWMake && !this->BorlandMakeCurlyHack)
+ if(!this->IsNMake()
+ && !this->IsWatcomWMake() && !this->BorlandMakeCurlyHack)
{
// turn off RCS and SCCS automatic stuff from gmake
makefileStream
@@ -810,7 +810,7 @@ cmLocalUnixMakefileGenerator3
depends.push_back(".hpux_make_needs_suffix_list");
this->WriteMakeRule(makefileStream, 0,
".SUFFIXES", depends, no_commands, false);
- if(this->WatcomWMake)
+ if(this->IsWatcomWMake())
{
// Switch on WMake feature, if an error or interrupt occurs during
// makefile processing, the current target being made may be deleted
@@ -828,7 +828,7 @@ cmLocalUnixMakefileGenerator3
<< "VERBOSE = 1\n"
<< "\n";
}
- if(this->WatcomWMake)
+ if(this->IsWatcomWMake())
{
makefileStream <<
"!ifndef VERBOSE\n"
@@ -962,7 +962,7 @@ cmLocalUnixMakefileGenerator3
void cmLocalUnixMakefileGenerator3::AppendFlags(std::string& flags,
const std::string& newFlags)
{
- if(this->WatcomWMake && !newFlags.empty())
+ if(this->IsWatcomWMake() && !newFlags.empty())
{
std::string newf = newFlags;
if(newf.find("\\\"") != newf.npos)
@@ -1112,7 +1112,7 @@ cmLocalUnixMakefileGenerator3
//
bool useCall = false;
- if (this->WindowsShell)
+ if (this->IsWindowsShell())
{
std::string suffix;
if (cmd.size() > 4)
@@ -1179,7 +1179,7 @@ cmLocalUnixMakefileGenerator3
{
cmd = "call " + cmd;
}
- else if (this->NMake && cmd[0]=='"')
+ else if (this->IsNMake() && cmd[0]=='"')
{
cmd = "echo >nul && " + cmd;
}
@@ -2344,7 +2344,7 @@ void cmLocalUnixMakefileGenerator3
// used by NMake and Borland make does not support "cd /d" so this
// feature simply cannot work with them (Borland make does not even
// support changing the drive letter with just "d:").
- const char* cd_cmd = this->MinGWMake? "cd /d " : "cd ";
+ const char* cd_cmd = this->IsMinGWMake() ? "cd /d " : "cd ";
if(!this->UnixCD)
{
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index 4e48ad7..7b436a5 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -81,36 +81,6 @@ public:
std::string &GetMakeSilentFlag() { return this->MakeSilentFlag; }
/**
- * Set to true if the shell being used is the windows shell.
- * This controls if statements in the makefile and the SHELL variable.
- * The default is false.
- */
- void SetWindowsShell(bool v) {this->WindowsShell = v;}
-
- /**
- * Set to true if the make tool being used is Watcom WMake.
- */
- void SetWatcomWMake(bool v) {this->WatcomWMake = v;}
-
- /**
- * Set to true if the make tool being used is MinGW Make.
- */
- void SetMinGWMake(bool v) {this->MinGWMake = v;}
- bool IsMinGWMake() const { return this->MinGWMake; }
-
- /**
- * Set to true if the make tool being used is NMake.
- */
- void SetNMake(bool v) {this->NMake = v;}
-
- /**
- * Set to true if the shell being used is the MSYS shell.
- * This controls if statements in the makefile and the SHELL variable.
- * The default is false.
- */
- void SetMSYSShell(bool v) {this->MSYSShell = v;}
-
- /**
* If set to true, then NULL is set to nil for non Windows_NT.
* This uses make syntax used by nmake and borland.
* The default is false.
diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx
index f95d09b..4a596d5 100644
--- a/Source/cmLocalVisualStudioGenerator.cxx
+++ b/Source/cmLocalVisualStudioGenerator.cxx
@@ -23,8 +23,6 @@ cmLocalVisualStudioGenerator
cmLocalGenerator* parent)
: cmLocalGenerator(gg, parent)
{
- this->WindowsShell = true;
- this->WindowsVSIDE = true;
this->Version = v;
}
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list