diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 9912c6fff..c5a836abf 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -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& diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 90779a57f..1c2128ae7 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -236,6 +236,12 @@ public: std::string ConvertToRelativePath(const std::vector& 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. */ diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index e60a5d231..3ba20f8d8 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -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(); diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h index 8f9bef712..bc3f7d6a6 100644 --- a/Source/cmLocalUnixMakefileGenerator3.h +++ b/Source/cmLocalUnixMakefileGenerator3.h @@ -188,7 +188,7 @@ public: void AppendEcho(std::vector& 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& commands, diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index a3e07693b..0a48d83a1 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -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* , diff --git a/Source/cmLocalVisualStudio6Generator.h b/Source/cmLocalVisualStudio6Generator.h index 97d45d4a9..d97a8db77 100644 --- a/Source/cmLocalVisualStudio6Generator.h +++ b/Source/cmLocalVisualStudio6Generator.h @@ -62,6 +62,7 @@ public: { return this->CreatedProjectNames; } + virtual std::string GetTargetDirectory(cmTarget const& target) const; void GetTargetObjectFileDirectories(cmTarget* target, std::vector& dirs); diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index c4d7a35b3..5f9ab7a99 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1619,7 +1619,7 @@ void cmLocalVisualStudio7Generator::ConfigureFinalPass() //---------------------------------------------------------------------------- std::string cmLocalVisualStudio7Generator -::GetTargetDirectory(cmTarget& target) +::GetTargetDirectory(cmTarget const& target) const { std::string dir; dir += target.GetName(); diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h index d6761084c..508c36874 100644 --- a/Source/cmLocalVisualStudio7Generator.h +++ b/Source/cmLocalVisualStudio7Generator.h @@ -113,7 +113,7 @@ private: void WriteGroup(const cmSourceGroup *sg, cmTarget target, std::ostream &fout, const char *libName, std::vector *configs); - virtual std::string GetTargetDirectory(cmTarget&); + virtual std::string GetTargetDirectory(cmTarget const&) const; cmVS7FlagTable const* ExtraFlagTable; std::string ModuleDefinitionFile; diff --git a/Source/cmLocalXCodeGenerator.cxx b/Source/cmLocalXCodeGenerator.cxx index 27a91900b..7f60402e7 100644 --- a/Source/cmLocalXCodeGenerator.cxx +++ b/Source/cmLocalXCodeGenerator.cxx @@ -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& diff --git a/Source/cmLocalXCodeGenerator.h b/Source/cmLocalXCodeGenerator.h index b265d6b8b..456fc05c1 100644 --- a/Source/cmLocalXCodeGenerator.h +++ b/Source/cmLocalXCodeGenerator.h @@ -35,6 +35,7 @@ public: void GetTargetObjectFileDirectories(cmTarget* target, std::vector& dirs); + virtual std::string GetTargetDirectory(cmTarget const& target) const; private: };