summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-08-01 15:25:40 -0400
committerBrad King <brad.king@kitware.com>2007-08-01 15:25:40 -0400
commitea874415d9f1a1058aadb38c6987b18d8b3324f5 (patch)
treed057bde4debad9f639903126bccf6854be6ced13 /Source
parent2246e0336db396058ebcec67527bf790a34a8e72 (diff)
downloadcmake-ea874415d9f1a1058aadb38c6987b18d8b3324f5.tar.gz
ENH: Moved GetTargetDirectory method up to cmLocalGenerator. This provides a common interface to something that was implemented in most local generators anyway.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalGenerator.cxx12
-rw-r--r--Source/cmLocalGenerator.h6
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx3
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.h2
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx7
-rw-r--r--Source/cmLocalVisualStudio6Generator.h1
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx2
-rw-r--r--Source/cmLocalVisualStudio7Generator.h2
-rw-r--r--Source/cmLocalXCodeGenerator.cxx7
-rw-r--r--Source/cmLocalXCodeGenerator.h1
10 files changed, 39 insertions, 4 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 9912c6fff3..c5a836abf5 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<std::string>&
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 90779a57f7..1c2128ae74 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -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. */
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index e60a5d231c..3ba20f8d87 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 8f9bef7125..bc3f7d6a67 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -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,
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index a3e07693ba..0a48d83a1d 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 97d45d4a9d..d97a8db771 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<std::string>&
dirs);
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index c4d7a35b35..5f9ab7a990 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 d6761084c3..508c368747 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<std::string> *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 27a91900b5..7f60402e7d 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<std::string>&
diff --git a/Source/cmLocalXCodeGenerator.h b/Source/cmLocalXCodeGenerator.h
index b265d6b8b2..456fc05c1a 100644
--- a/Source/cmLocalXCodeGenerator.h
+++ b/Source/cmLocalXCodeGenerator.h
@@ -35,6 +35,7 @@ public:
void GetTargetObjectFileDirectories(cmTarget* target,
std::vector<std::string>&
dirs);
+ virtual std::string GetTargetDirectory(cmTarget const& target) const;
private:
};