diff options
author | David Cole <david.cole@kitware.com> | 2010-09-13 13:29:10 -0400 |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2010-09-13 15:22:15 -0400 |
commit | ed37fc3ea398b03bbba175ae337f14b6af58daee (patch) | |
tree | 6a06ceab703d31784a99fed043e3548ea5e5f181 /Source | |
parent | e79e412e70cb439354df589d83d3878c4dbe62fc (diff) | |
download | cmake-ed37fc3ea398b03bbba175ae337f14b6af58daee.tar.gz |
VS2010: Set IntDir for utility and global targets.
VS2010 uses IntDir as the location for writing log files for
what happens during custom build steps. With no IntDir settings,
all ExternalProject usage within the same CMakeLists.txt file
would result in multiple utility targets all trying to use the
same custom build log files.
With parallel builds, they would try to use them simultaneously
and result in file access errors, preventing the builds from
completing successfully.
Now each utility target has its own IntDir setting, and so, its
own custom build rule log files.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 73 |
1 files changed, 45 insertions, 28 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index b374579664..b290aed731 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -814,10 +814,12 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions() { - if(this->Target->GetType() > cmTarget::MODULE_LIBRARY) + cmTarget::TargetType ttype = this->Target->GetType(); + if(ttype > cmTarget::GLOBAL_TARGET) { return; } + this->WriteString("<PropertyGroup>\n", 2); this->WriteString("<_ProjectFileVersion>10.0.20506.1" "</_ProjectFileVersion>\n", 3); @@ -827,33 +829,48 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions() for(std::vector<std::string>::iterator config = configs->begin(); config != configs->end(); ++config) { - std::string targetNameFull = - this->Target->GetFullName(config->c_str()); - std::string intermediateDir = this->LocalGenerator-> - GetTargetDirectory(*this->Target); - intermediateDir += "/"; - intermediateDir += *config; - intermediateDir += "/"; - this->ConvertToWindowsSlash(intermediateDir); - std::string outDir = this->Target->GetDirectory(config->c_str()); - this->ConvertToWindowsSlash(outDir); - this->WritePlatformConfigTag("OutDir", config->c_str(), 3); - *this->BuildFileStream << outDir - << "\\" - << "</OutDir>\n"; - this->WritePlatformConfigTag("IntDir", config->c_str(), 3); - *this->BuildFileStream << intermediateDir - << "</IntDir>\n"; - this->WritePlatformConfigTag("TargetName", config->c_str(), 3); - *this->BuildFileStream - << cmSystemTools::GetFilenameWithoutLastExtension( - targetNameFull.c_str()) - << "</TargetName>\n"; - this->WritePlatformConfigTag("TargetExt", config->c_str(), 3); - *this->BuildFileStream << cmSystemTools::GetFilenameLastExtension( - targetNameFull.c_str()) - << "</TargetExt>\n"; - this->OutputLinkIncremental(*config); + if(ttype >= cmTarget::UTILITY) + { + this->WritePlatformConfigTag("IntDir", config->c_str(), 3); + *this->BuildFileStream + << "$(Platform)\\$(Configuration)\\$(ProjectName)\\" + << "</IntDir>\n"; + } + else + { + std::string targetNameFull = + this->Target->GetFullName(config->c_str()); + std::string intermediateDir = this->LocalGenerator-> + GetTargetDirectory(*this->Target); + intermediateDir += "/"; + intermediateDir += *config; + intermediateDir += "/"; + this->ConvertToWindowsSlash(intermediateDir); + std::string outDir = this->Target->GetDirectory(config->c_str()); + this->ConvertToWindowsSlash(outDir); + + this->WritePlatformConfigTag("OutDir", config->c_str(), 3); + *this->BuildFileStream << outDir + << "\\" + << "</OutDir>\n"; + + this->WritePlatformConfigTag("IntDir", config->c_str(), 3); + *this->BuildFileStream << intermediateDir + << "</IntDir>\n"; + + this->WritePlatformConfigTag("TargetName", config->c_str(), 3); + *this->BuildFileStream + << cmSystemTools::GetFilenameWithoutLastExtension( + targetNameFull.c_str()) + << "</TargetName>\n"; + + this->WritePlatformConfigTag("TargetExt", config->c_str(), 3); + *this->BuildFileStream + << cmSystemTools::GetFilenameLastExtension(targetNameFull.c_str()) + << "</TargetExt>\n"; + + this->OutputLinkIncremental(*config); + } } this->WriteString("</PropertyGroup>\n", 2); } |