From 15ca72a862ce23f2b9738255d11168b57ef656a8 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 19 Jun 2006 14:57:57 -0400 Subject: BUG: Delay relative path configuration until as late as possible to make sure the source/binary dir are set. This is a work-around for lack of a more structured way of creating the global generator. --- Source/cmGlobalGenerator.cxx | 13 ++++++++++--- Source/cmGlobalGenerator.h | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index d840b8a..49b0e1e 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -39,6 +39,9 @@ cmGlobalGenerator::cmGlobalGenerator() // By default do not use link scripts. this->UseLinkScript = false; + + // Relative paths are not configured in the constructor. + this->RelativePathsConfigured = false; } cmGlobalGenerator::~cmGlobalGenerator() @@ -1098,6 +1101,13 @@ std::string cmGlobalGenerator return in_remote; } + // Make sure relative path conversion is configured. + if(!this->RelativePathsConfigured) + { + this->ConfigureRelativePaths(); + this->RelativePathsConfigured = true; + } + std::string original = in_remote; // Skip conversion if the path and local are not both in the source or both @@ -1224,9 +1234,6 @@ void cmGlobalGenerator::SetCMakeInstance(cmake* cm) { // Store a pointer to the cmake object instance. this->CMakeInstance = cm; - - // Setup relative path conversion for the instance. - this->ConfigureRelativePaths(); } void cmGlobalGenerator::SetupTests() diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 7a05783..07ee8d8 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -200,6 +200,7 @@ protected: bool IsExcluded(cmLocalGenerator* root, cmLocalGenerator* gen); void ConfigureRelativePaths(); + bool RelativePathsConfigured; void SetupTests(); void CreateDefaultGlobalTargets(cmTargets* targets); -- cgit v0.12