summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudio7Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2005-07-27 17:36:36 (GMT)
committerBrad King <brad.king@kitware.com>2005-07-27 17:36:36 (GMT)
commitf9aef0e422b7e308d48bb409c435cc78739c4804 (patch)
treeee26bbf79a839a833431648791b6ec2ce19c932a /Source/cmLocalVisualStudio7Generator.cxx
parent4a98fcd0595b4ea270143bb5aeac7f2c6a4d46f6 (diff)
downloadCMake-f9aef0e422b7e308d48bb409c435cc78739c4804.zip
CMake-f9aef0e422b7e308d48bb409c435cc78739c4804.tar.gz
CMake-f9aef0e422b7e308d48bb409c435cc78739c4804.tar.bz2
ENH: Generator now creates a separate intermediate files directory for each target. This is needed for MSVC 8 to support parallel builds.
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx34
1 files changed, 27 insertions, 7 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index a583613..2b125df 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -421,8 +421,15 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
programDatabase += libpath;
programDatabase += "\"";
}
-
- fout << "\t\t\tIntermediateDirectory=\".\\" << configName << "\"\n"
+
+ // The intermediate directory name consists of a directory for the
+ // target and a subdirectory for the configuration name.
+ std::string intermediateDir = this->GetTargetDirectory(target);
+ intermediateDir += "/";
+ intermediateDir += configName;
+ fout << "\t\t\tIntermediateDirectory=\""
+ << this->ConvertToXMLOutputPath(intermediateDir.c_str())
+ << "\"\n"
<< "\t\t\tConfigurationType=\"" << configType << "\"\n"
<< "\t\t\tUseOfMFC=\"" << mfcFlag << "\"\n"
<< "\t\t\tATLMinimizesCRunTimeLibraryUsage=\"FALSE\"\n";
@@ -505,7 +512,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
this->OutputDefineFlags(defineFlags.c_str(), fout);
fout << "\"\n";
fout << "\t\t\t\tAssemblerListingLocation=\"" << configName << "\"\n";
- fout << "\t\t\t\tObjectFile=\"" << configName << "\\\"\n";
+ fout << "\t\t\t\tObjectFile=\"$(IntDir)\\\"\n";
if(m_Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"))
{
fout << "\t\t\t\tSuppressStartupBanner=\"FALSE\"\n";
@@ -822,7 +829,7 @@ void cmLocalVisualStudio7Generator::OutputLibraryDirectories(std::ostream& fout,
{
hasone = true;
std::string temp = m_LibraryOutputPath;
- temp += "$(INTDIR)";
+ temp += "$(OutDir)";
fout << this->ConvertToXMLOutputPath(temp.c_str()) << "," <<
this->ConvertToXMLOutputPath(m_LibraryOutputPath.c_str());
@@ -836,7 +843,7 @@ void cmLocalVisualStudio7Generator::OutputLibraryDirectories(std::ostream& fout,
}
hasone = true;
std::string temp = m_ExecutableOutputPath;
- temp += "$(INTDIR)";
+ temp += "$(OutDir)";
fout << this->ConvertToXMLOutputPath(temp.c_str()) << "," <<
this->ConvertToXMLOutputPath(m_ExecutableOutputPath.c_str());
}
@@ -857,7 +864,7 @@ void cmLocalVisualStudio7Generator::OutputLibraryDirectories(std::ostream& fout,
{
fout << ",";
}
- std::string lpathi = lpath + "$(INTDIR)";
+ std::string lpathi = lpath + "$(OutDir)";
fout << this->ConvertToXMLOutputPath(lpathi.c_str()) << "," <<
this->ConvertToXMLOutputPath(lpath.c_str());
hasone = true;
@@ -1204,7 +1211,7 @@ WriteCustomRule(std::ostream& fout,
libPath = cacheValue;
}
libPath += "/";
- libPath += "$(INTDIR)/";
+ libPath += "$(OutDir)/";
libPath += dep;
libPath += ".exe";
fout << this->ConvertToXMLOutputPath(libPath.c_str())
@@ -1418,3 +1425,16 @@ void cmLocalVisualStudio7Generator::ConfigureFinalPass()
}
+//----------------------------------------------------------------------------
+std::string cmLocalVisualStudio7Generator::GetTargetDirectory(cmTarget& target)
+{
+ std::string dir;
+ // Put a prefix on the name if one is given by the CMake code.
+ if(const char* prefix = m_Makefile->GetDefinition("CMAKE_TARGET_DIR_PREFIX"))
+ {
+ dir += prefix;
+ }
+ dir += target.GetName();
+ dir += ".dir";
+ return dir;
+}