diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2006-11-25 15:59:26 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2006-11-25 15:59:26 (GMT) |
commit | 9baa760315f440b6c32087cdd5918d8a46c188d7 (patch) | |
tree | 1454ddd6ef39ce8676bd375c4f9e6fa8e358ad96 /Source/cmLocalGenerator.cxx | |
parent | 3ad6f7e8808333133cec8ab3bb8856df31ccc873 (diff) | |
download | CMake-9baa760315f440b6c32087cdd5918d8a46c188d7.zip CMake-9baa760315f440b6c32087cdd5918d8a46c188d7.tar.gz CMake-9baa760315f440b6c32087cdd5918d8a46c188d7.tar.bz2 |
BUG: fix problem when a target name is the same as the output of a custom command
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 2909b33..84de442 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1857,6 +1857,22 @@ std::string cmLocalGenerator::GetRealDependency(const char* inName, // Look for a CMake target with the given name. if(cmTarget* target = this->GlobalGenerator->FindTarget(0, name.c_str())) { + // make sure it is not just a coincidence that the target name + // found is part of the inName + if(cmSystemTools::FileIsFullPath(inName)) + { + std::string tLocation = target->GetLocation(config); + tLocation = cmSystemTools::GetFilenamePath(tLocation); + std::string depLocation = cmSystemTools::GetFilenamePath( + std::string(inName)); + if(depLocation != tLocation) + { + // it is a full path to a depend that has the same name + // as a target but is in a different location so do not use + // the target as the depend + return inName; + } + } switch (target->GetType()) { case cmTarget::EXECUTABLE: |