BUG: Fixed cmTarget::GetFullPath to not append the configuration name when only one configuration is built. It now asks the generator what subdirectory if any to use for a given configuration name.

This commit is contained in:
Brad King 2006-02-03 11:36:11 -05:00
parent 0f5aced502
commit afa8367885
8 changed files with 61 additions and 9 deletions

View File

@ -1183,3 +1183,11 @@ void cmGlobalGenerator::SetupTests()
} }
} }
} }
//----------------------------------------------------------------------------
void cmGlobalGenerator::AppendDirectoryForConfig(const char*, std::string&)
{
// Subclasses that support multiple configurations should implement
// this method to append the subdirectory for the given build
// configuration.
}

View File

@ -149,6 +149,9 @@ public:
///! Find a local generator by its startdirectory ///! Find a local generator by its startdirectory
cmLocalGenerator* FindLocalGenerator(const char* start_dir); cmLocalGenerator* FindLocalGenerator(const char* start_dir);
/** Append the subdirectory for the given configuration. */
virtual void AppendDirectoryForConfig(const char* config, std::string& dir);
protected: protected:
// Fill the m_ProjectMap, this must be called after m_LocalGenerators has been populated. // Fill the m_ProjectMap, this must be called after m_LocalGenerators has been populated.
void FillProjectMap(); void FillProjectMap();

View File

@ -486,3 +486,15 @@ void cmGlobalVisualStudio6Generator::GetDocumentation(cmDocumentationEntry& entr
entry.brief = "Generates Visual Studio 6 project files."; entry.brief = "Generates Visual Studio 6 project files.";
entry.full = ""; entry.full = "";
} }
//----------------------------------------------------------------------------
void
cmGlobalVisualStudio6Generator
::AppendDirectoryForConfig(const char* config, std::string& dir)
{
if(config)
{
dir += "/";
dir += config;
}
}

View File

@ -74,6 +74,10 @@ public:
virtual void WriteDSWFile(std::ostream& fout, virtual void WriteDSWFile(std::ostream& fout,
cmLocalGenerator* root, cmLocalGenerator* root,
std::vector<cmLocalGenerator*>& generators); std::vector<cmLocalGenerator*>& generators);
/** Append the subdirectory for the given configuration. */
virtual void AppendDirectoryForConfig(const char* config, std::string& dir);
private: private:
void GenerateConfigurations(cmMakefile* mf); void GenerateConfigurations(cmMakefile* mf);
void WriteDSWFile(std::ostream& fout); void WriteDSWFile(std::ostream& fout);

View File

@ -718,3 +718,15 @@ void cmGlobalVisualStudio7Generator::Configure()
this->CreateGUID("INSTALL"); this->CreateGUID("INSTALL");
this->CreateGUID("RUN_TESTS"); this->CreateGUID("RUN_TESTS");
} }
//----------------------------------------------------------------------------
void
cmGlobalVisualStudio7Generator
::AppendDirectoryForConfig(const char* config, std::string& dir)
{
if(config)
{
dir += "/";
dir += config;
}
}

View File

@ -81,6 +81,9 @@ public:
///! do configure step ///! do configure step
virtual void Configure(); virtual void Configure();
/** Append the subdirectory for the given configuration. */
virtual void AppendDirectoryForConfig(const char* config, std::string& dir);
protected: protected:
virtual void OutputSLNFile(cmLocalGenerator* root, virtual void OutputSLNFile(cmLocalGenerator* root,
std::vector<cmLocalGenerator*>& generators); std::vector<cmLocalGenerator*>& generators);

View File

@ -2284,3 +2284,18 @@ std::string cmGlobalXCodeGenerator::XCodeEscapePath(const char* p)
} }
return ret; return ret;
} }
//----------------------------------------------------------------------------
void
cmGlobalXCodeGenerator
::AppendDirectoryForConfig(const char* config, std::string& dir)
{
if(m_XcodeVersion > 20)
{
if(config)
{
dir += "/";
dir += config;
}
}
}

View File

@ -1054,18 +1054,13 @@ std::string cmTarget::GetFullPath(const char* config)
{ {
// Start with the output directory for the target. // Start with the output directory for the target.
std::string fpath = this->GetDirectory(); std::string fpath = this->GetDirectory();
fpath += "/";
// Add the configuration's subdirectory. This may need to be replaced with // Add the configuration's subdirectory.
// a call into the generator found through m_Makefile so that each m_Makefile->GetLocalGenerator()->GetGlobalGenerator()->
// generator can map configuration names to output directories its own way. AppendDirectoryForConfig(config, fpath);
if(config)
{
fpath += config;
fpath += "/";
}
// Add the full name of the target. // Add the full name of the target.
fpath += "/";
fpath += this->GetFullName(config); fpath += this->GetFullName(config);
return fpath; return fpath;
} }