diff options
author | Brad King <brad.king@kitware.com> | 2007-03-08 13:38:40 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2007-03-08 13:38:40 (GMT) |
commit | 2f2b5b25034c5b26bf59dc4dc900c21d448ad30b (patch) | |
tree | bc117b62fd8ee0a30564e8e260373667436192ad | |
parent | 9a5a051f2134f3a5ca2d4d04286770239ef32ca3 (diff) | |
download | CMake-2f2b5b25034c5b26bf59dc4dc900c21d448ad30b.zip CMake-2f2b5b25034c5b26bf59dc4dc900c21d448ad30b.tar.gz CMake-2f2b5b25034c5b26bf59dc4dc900c21d448ad30b.tar.bz2 |
ENH: SetupPathConversions is now called automatically on demand.
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.cxx | 1 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 12 | ||||
-rw-r--r-- | Source/cmLocalGenerator.h | 5 | ||||
-rw-r--r-- | Source/cmake.cxx | 1 |
4 files changed, 11 insertions, 8 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 30771b9..234f0d0 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -597,7 +597,6 @@ std::string cmGlobalUnixMakefileGenerator3 lg->GetMakefile()->MakeStartDirectoriesCurrent(); } - lg->SetupPathConversions(); makeCommand += " \""; std::string tname = targetName; if(fast) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 789cb11..7a6fe86 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -48,6 +48,7 @@ cmLocalGenerator::cmLocalGenerator() this->Configured = false; this->EmitUniversalBinaryFlags = true; this->RelativePathsConfigured = false; + this->PathConversionsSetup = false; } cmLocalGenerator::~cmLocalGenerator() @@ -80,9 +81,7 @@ void cmLocalGenerator::Configure() this->Makefile->ConfigureSubDirectory(*sdi); } } - - this->SetupPathConversions(); - + // Check whether relative paths should be used for optionally // relative paths. this->UseRelativePaths = this->Makefile->IsOn("CMAKE_USE_RELATIVE_PATHS"); @@ -2014,6 +2013,13 @@ std::string cmLocalGenerator::Convert(const char* 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; diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index fbeb056..4690da5 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -102,9 +102,6 @@ public: OutputFormat output = UNCHANGED, bool optional = false); - ///! Call this prior to using Convert - void SetupPathConversions(); - /** * Convert the given path to an output path that is optionally * relative based on the cache option CMAKE_USE_RELATIVE_PATHS. The @@ -279,6 +276,7 @@ protected: void ConfigureRelativePaths(); std::string FindRelativePathTopSource(); std::string FindRelativePathTopBinary(); + void SetupPathConversions(); cmMakefile *Makefile; cmGlobalGenerator *GlobalGenerator; @@ -314,6 +312,7 @@ protected: std::string RelativePathTopSource; std::string RelativePathTopBinary; bool RelativePathsConfigured; + bool PathConversionsSetup; }; #endif diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 629713e..6f6c4cd 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1210,7 +1210,6 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args) lgd->GetMakefile()->SetStartDirectory(startDir.c_str()); lgd->GetMakefile()->SetStartOutputDirectory(startOutDir.c_str()); lgd->GetMakefile()->MakeStartDirectoriesCurrent(); - lgd->SetupPathConversions(); // Actually scan dependencies. return lgd->ScanDependencies(depInfo.c_str())? 0 : 2; |