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/cmLocalGenerator.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/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 7589520..e24c52d 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1837,12 +1837,17 @@ std::string cmLocalGenerator::GetRealDependency(const char* inName, // found is part of the inName if(cmSystemTools::FileIsFullPath(inName)) { - std::string tLocation = target->GetLocation(config); - tLocation = cmSystemTools::GetFilenamePath(tLocation); + std::string tLocation; + if(target->GetType() >= cmTarget::EXECUTABLE && + target->GetType() <= cmTarget::MODULE_LIBRARY) + { + tLocation = target->GetLocation(config); + tLocation = cmSystemTools::GetFilenamePath(tLocation); + tLocation = cmSystemTools::CollapseFullPath(tLocation.c_str()); + } std::string depLocation = cmSystemTools::GetFilenamePath( std::string(inName)); depLocation = cmSystemTools::CollapseFullPath(depLocation.c_str()); - tLocation = cmSystemTools::CollapseFullPath(tLocation.c_str()); if(depLocation != tLocation) { // it is a full path to a depend that has the same name |