Commit ea874415 authored by Brad King's avatar Brad King
Browse files

ENH: Moved GetTargetDirectory method up to cmLocalGenerator. This provides a...

ENH: Moved GetTargetDirectory method up to cmLocalGenerator.  This provides a common interface to something that was implemented in most local generators anyway.
parent 2246e033
......@@ -2772,6 +2772,18 @@ std::string cmLocalGenerator::EscapeForShell(const char* str, bool makeVars,
}
return std::string(&arg[0]);
}
//----------------------------------------------------------------------------
std::string
cmLocalGenerator::GetTargetDirectory(cmTarget const&) const
{
cmSystemTools::Error("GetTargetDirectory"
" called on cmLocalGenerator");
return "";
}
//----------------------------------------------------------------------------
void
cmLocalGenerator::GetTargetObjectFileDirectories(cmTarget* ,
std::vector<std::string>&
......
......@@ -236,6 +236,12 @@ public:
std::string ConvertToRelativePath(const std::vector<std::string>& local,
const char* remote);
/**
* Get the relative path from the generator output directory to a
* per-target support directory.
*/
virtual std::string GetTargetDirectory(cmTarget const& target) const;
protected:
/** Construct a comment for a custom command. */
......
......@@ -1897,7 +1897,8 @@ cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p)
//----------------------------------------------------------------------------
std::string
cmLocalUnixMakefileGenerator3::GetTargetDirectory(cmTarget& target)
cmLocalUnixMakefileGenerator3
::GetTargetDirectory(cmTarget const& target) const
{
std::string dir = cmake::GetCMakeFilesDirectoryPostSlash();
dir += target.GetName();
......
......@@ -188,7 +188,7 @@ public:
void AppendEcho(std::vector<std::string>& commands, const char* text,
EchoColor color = EchoNormal);
static std::string GetTargetDirectory(cmTarget& target);
virtual std::string GetTargetDirectory(cmTarget const& target) const;
// create a command that cds to the start dir then runs the commands
void CreateCDCommand(std::vector<std::string>& commands,
......
......@@ -1567,6 +1567,13 @@ void cmLocalVisualStudio6Generator
}
}
std::string
cmLocalVisualStudio6Generator
::GetTargetDirectory(cmTarget const&) const
{
// No per-target directory for this generator (yet).
return "";
}
void cmLocalVisualStudio6Generator
::GetTargetObjectFileDirectories(cmTarget* ,
......
......@@ -62,6 +62,7 @@ public:
{
return this->CreatedProjectNames;
}
virtual std::string GetTargetDirectory(cmTarget const& target) const;
void GetTargetObjectFileDirectories(cmTarget* target,
std::vector<std::string>&
dirs);
......
......@@ -1619,7 +1619,7 @@ void cmLocalVisualStudio7Generator::ConfigureFinalPass()
//----------------------------------------------------------------------------
std::string cmLocalVisualStudio7Generator
::GetTargetDirectory(cmTarget& target)
::GetTargetDirectory(cmTarget const& target) const
{
std::string dir;
dir += target.GetName();
......
......@@ -113,7 +113,7 @@ private:
void WriteGroup(const cmSourceGroup *sg,
cmTarget target, std::ostream &fout,
const char *libName, std::vector<std::string> *configs);
virtual std::string GetTargetDirectory(cmTarget&);
virtual std::string GetTargetDirectory(cmTarget const&) const;
cmVS7FlagTable const* ExtraFlagTable;
std::string ModuleDefinitionFile;
......
......@@ -13,6 +13,13 @@ cmLocalXCodeGenerator::~cmLocalXCodeGenerator()
{
}
std::string
cmLocalXCodeGenerator::GetTargetDirectory(cmTarget const&) const
{
// No per-target directory for this generator (yet).
return "";
}
void cmLocalXCodeGenerator::
GetTargetObjectFileDirectories(cmTarget* target,
std::vector<std::string>&
......
......@@ -35,6 +35,7 @@ public:
void GetTargetObjectFileDirectories(cmTarget* target,
std::vector<std::string>&
dirs);
virtual std::string GetTargetDirectory(cmTarget const& target) const;
private:
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment