summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudio6Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-07-03 14:33:49 (GMT)
committerBrad King <brad.king@kitware.com>2009-07-03 14:33:49 (GMT)
commit43669f0ef279a88816e8b9053beed6e9ee772ab5 (patch)
treef5b0c1c93c525cec00c9dc4c2815331657bf0f15 /Source/cmLocalVisualStudio6Generator.cxx
parent44021718a6358d8b93168b04e2c457d8799182b8 (diff)
downloadCMake-43669f0ef279a88816e8b9053beed6e9ee772ab5.zip
CMake-43669f0ef279a88816e8b9053beed6e9ee772ab5.tar.gz
CMake-43669f0ef279a88816e8b9053beed6e9ee772ab5.tar.bz2
BUG: Avoid cmTarget::GetDirectory for utilities
Since utility targets have no main output files like executables or libraries, they do not define an output directory. This removes a call to cmTarget::GetDirectory from cmLocalVisualStudio{6,7}Generator for such targets.
Diffstat (limited to 'Source/cmLocalVisualStudio6Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx16
1 files changed, 9 insertions, 7 deletions
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index bcd908e..faf6792 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -882,9 +882,6 @@ void cmLocalVisualStudio6Generator
const char *libName, cmTarget &target,
std::vector<cmSourceGroup> &)
{
- // Lookup the output directory for the target.
- std::string outPath = target.GetDirectory();
-
bool targetBuilds = (target.GetType() >= cmTarget::EXECUTABLE &&
target.GetType() <= cmTarget::MODULE_LIBRARY);
#ifdef CM_USE_OLD_VS6
@@ -1415,10 +1412,15 @@ void cmLocalVisualStudio6Generator
removeQuotes(this->ConvertToOptionallyRelativeOutputPath
(exePath.c_str())).c_str());
#endif
- cmSystemTools::ReplaceString
- (line, "OUTPUT_DIRECTORY",
- removeQuotes(this->ConvertToOptionallyRelativeOutputPath
- (outPath.c_str())).c_str());
+
+ if(targetBuilds)
+ {
+ std::string outPath = target.GetDirectory();
+ cmSystemTools::ReplaceString
+ (line, "OUTPUT_DIRECTORY",
+ removeQuotes(this->ConvertToOptionallyRelativeOutputPath
+ (outPath.c_str())).c_str());
+ }
cmSystemTools::ReplaceString(line,
"EXTRA_DEFINES",