diff options
author | David Cole <david.cole@kitware.com> | 2009-09-25 17:23:19 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2009-09-25 17:23:19 (GMT) |
commit | f199385605b228d73060f87647922fbe4c17779c (patch) | |
tree | 8340674f36f19b94adb837b781e295300274776d /Source/cmTarget.cxx | |
parent | 9c626d8f68b6ec35204c79e936e16a7a7d7471d0 (diff) | |
download | CMake-f199385605b228d73060f87647922fbe4c17779c.zip CMake-f199385605b228d73060f87647922fbe4c17779c.tar.gz CMake-f199385605b228d73060f87647922fbe4c17779c.tar.bz2 |
Fix CMake Internal Error from cmTarget::GetOutputInfo - triggered by calling GetLocation on a utility target - caused by custom command output file with same name as custom target. The fix is to avoid calling GetLocation unless the target is of a type that is expected to have a location...
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 3882253..0890644 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1244,17 +1244,21 @@ bool cmTargetTraceDependencies::IsUtility(std::string const& dep) // the fact that the name matched a target was just a coincidence. if(cmSystemTools::FileIsFullPath(dep.c_str())) { - // This is really only for compatibility so we do not need to - // worry about configuration names and output names. - std::string tLocation = t->GetLocation(0); - tLocation = cmSystemTools::GetFilenamePath(tLocation); - std::string depLocation = cmSystemTools::GetFilenamePath(dep); - depLocation = cmSystemTools::CollapseFullPath(depLocation.c_str()); - tLocation = cmSystemTools::CollapseFullPath(tLocation.c_str()); - if(depLocation == tLocation) + if(t->GetType() >= cmTarget::EXECUTABLE && + t->GetType() <= cmTarget::MODULE_LIBRARY) { - this->Target->AddUtility(util.c_str()); - return true; + // This is really only for compatibility so we do not need to + // worry about configuration names and output names. + std::string tLocation = t->GetLocation(0); + tLocation = cmSystemTools::GetFilenamePath(tLocation); + std::string depLocation = cmSystemTools::GetFilenamePath(dep); + depLocation = cmSystemTools::CollapseFullPath(depLocation.c_str()); + tLocation = cmSystemTools::CollapseFullPath(tLocation.c_str()); + if(depLocation == tLocation) + { + this->Target->AddUtility(util.c_str()); + return true; + } } } else |