summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-03-08 20:33:19 (GMT)
committerBrad King <brad.king@kitware.com>2007-03-08 20:33:19 (GMT)
commit01dc699d82af9bca7d9f4c1bdc9e453e764861ba (patch)
tree5a74141a229e9737198b5e774ebb0c3f45942c2d
parent789a0f83594cd3bafcc9a3051a5ed53ec76c8684 (diff)
downloadCMake-01dc699d82af9bca7d9f4c1bdc9e453e764861ba.zip
CMake-01dc699d82af9bca7d9f4c1bdc9e453e764861ba.tar.gz
CMake-01dc699d82af9bca7d9f4c1bdc9e453e764861ba.tar.bz2
ENH: Combined cmTarget::GetDirectory and cmTarget::GetOutputDir since they are nearly the same. This is another step for bug#2240.
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx14
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx2
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx2
-rw-r--r--Source/cmMakefileTargetGenerator.cxx2
-rw-r--r--Source/cmTarget.cxx8
-rw-r--r--Source/cmTarget.h6
6 files changed, 19 insertions, 15 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index bd13095..218acc8 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -605,7 +605,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
target.GetType() == cmTarget::MODULE_LIBRARY))
{
fout << "\t\t\t\tProgramDataBaseFileName=\""
- << target.GetOutputDir() << "/$(OutDir)/"
+ << target.GetDirectory() << "/$(OutDir)/"
<< target.GetPDBName(configName) << "\"\n";
}
fout << "/>\n"; // end of <Tool Name=VCCLCompilerTool
@@ -728,7 +728,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
case cmTarget::STATIC_LIBRARY:
{
std::string targetNameFull = target.GetFullName(configName);
- std::string libpath = target.GetOutputDir();
+ std::string libpath = target.GetDirectory();
libpath += "/$(OutDir)/";
libpath += targetNameFull;
fout << "\t\t\t<Tool\n"
@@ -795,7 +795,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
<< " ";
this->OutputLibraries(fout, linkLibs);
fout << "\"\n";
- temp = target.GetOutputDir();
+ temp = target.GetDirectory();
temp += "/";
temp += configName;
temp += "/";
@@ -808,7 +808,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
this->OutputLibraryDirectories(fout, linkDirs);
fout << "\"\n";
this->OutputModuleDefinitionFile(fout, target);
- temp = target.GetOutputDir();
+ temp = target.GetDirectory();
temp += "/$(OutDir)/";
temp += targetNamePDB;
fout << "\t\t\t\tProgramDataBaseFile=\"" <<
@@ -826,7 +826,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
{
fout << "\t\t\t\tStackReserveSize=\"" << stackVal << "\"\n";
}
- temp = target.GetOutputDir();
+ temp = target.GetDirectory();
temp += "/";
temp += configName;
temp += "/";
@@ -875,7 +875,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
<< " ";
this->OutputLibraries(fout, linkLibs);
fout << "\"\n";
- temp = target.GetOutputDir();
+ temp = target.GetDirectory();
temp += "/";
temp += configName;
temp += "/";
@@ -888,7 +888,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
this->OutputLibraryDirectories(fout, linkDirs);
fout << "\"\n";
fout << "\t\t\t\tProgramDataBaseFile=\""
- << target.GetOutputDir() << "\\$(OutDir)\\" << targetNamePDB
+ << target.GetDirectory() << "\\$(OutDir)\\" << targetNamePDB
<< "\"\n";
if(strcmp(configName, "Debug") == 0
|| strcmp(configName, "RelWithDebInfo") == 0)
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 0bbcb73..2b56a5a 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -116,7 +116,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
this->LocalGenerator->ConfigurationName.c_str());
// Construct the full path version of the names.
- std::string outpath = this->Target->GetOutputDir();
+ std::string outpath = this->Target->GetDirectory();
outpath += "/";
#ifdef __APPLE__
if(this->Target->GetPropertyAsBool("MACOSX_BUNDLE"))
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 36021dc..786afa3 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -256,7 +256,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
}
else
{
- outpath = this->Target->GetOutputDir();
+ outpath = this->Target->GetDirectory();
outpath += "/";
}
std::string targetFullPath = outpath + targetName;
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 2e9ec76..8adcc9b 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -471,7 +471,7 @@ cmMakefileTargetGenerator
this->Target->GetType() == cmTarget::SHARED_LIBRARY ||
this->Target->GetType() == cmTarget::MODULE_LIBRARY)
{
- targetFullPathPDB = this->Target->GetOutputDir();
+ targetFullPathPDB = this->Target->GetDirectory();
targetFullPathPDB += "/";
targetFullPathPDB += this->Target->GetPDBName(configName);
}
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 3cffff6..f3e59e5 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1093,14 +1093,18 @@ void cmTarget::SetProperty(const char* prop, const char* value)
const char* cmTarget::GetDirectory(const char* config)
{
- this->Directory = this->GetOutputDir();
if(config)
{
+ this->Directory = this->GetOutputDir();
// Add the configuration's subdirectory.
this->Makefile->GetLocalGenerator()->GetGlobalGenerator()->
AppendDirectoryForConfig("/", config, "", this->Directory);
+ return this->Directory.c_str();
+ }
+ else
+ {
+ return this->GetOutputDir();
}
- return this->Directory.c_str();
}
const char* cmTarget::GetLocation(const char* config)
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 4e5bf6e..c58f853 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -213,9 +213,6 @@ public:
makefile and the configuration type. */
std::string GetFullPath(const char* config=0, bool implib = false);
- /** Get the full path to the target output directory. */
- const char* GetOutputDir();
-
/** Get the names of the library needed to generate a build rule
that takes into account shared library version numbers. This
should be called only on a library target. */
@@ -342,6 +339,9 @@ private:
// If the variable is not defined use the given default instead.
void SetPropertyDefault(const char* property, const char* default_value);
+ // Get the full path to the target output directory.
+ const char* GetOutputDir();
+
private:
std::string Name;
std::vector<cmCustomCommand> PreBuildCommands;