From 58d9cfa1411187cb904d40a82849cb88b3595fe9 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Thu, 28 Aug 2003 14:52:26 -0400 Subject: BUG: fix bug with custom commands depending on executables --- Source/cmLocalVisualStudio6Generator.cxx | 16 +++++++++++++--- Source/cmLocalVisualStudio7Generator.cxx | 16 +++++++++++++--- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index d0e4a11..8379ec5 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -375,7 +375,7 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout, fout << "USERDEP__HACK="; for(std::vector::const_iterator d = depends.begin(); d != depends.end(); ++d) - { + { fout << "\\\n\t" << cmSystemTools::ConvertToOutputPath(d->c_str()); } @@ -458,8 +458,18 @@ void cmLocalVisualStudio6Generator::WriteCustomRule(std::ostream& fout, for(std::vector::const_iterator d = depends.begin(); d != depends.end(); ++d) { - fout << "\\\n\t" << - cmSystemTools::ConvertToOutputPath(d->c_str()); + std::string dep = cmSystemTools::GetFilenameName(*d); + if (cmSystemTools::GetFilenameLastExtension(dep) == ".exe") + { + dep = cmSystemTools::GetFilenameWithoutLastExtension(dep); + } + std::string libPath = dep + "_CMAKE_PATH"; + const char* cacheValue = m_Makefile->GetDefinition(libPath.c_str()); + if (!cacheValue) + { + fout << "\\\n\t" << + cmSystemTools::ConvertToOutputPath(d->c_str()); + } } fout << "\n"; diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 991d43c..d307f2a 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -861,9 +861,19 @@ WriteCustomRule(std::ostream& fout, std::string temp; for(std::vector::const_iterator d = depends.begin(); d != depends.end(); ++d) - { - fout << this->ConvertToXMLOutputPath(d->c_str()) - << ";"; + { + std::string dep = cmSystemTools::GetFilenameName(*d); + if (cmSystemTools::GetFilenameLastExtension(dep) == ".exe") + { + dep = cmSystemTools::GetFilenameWithoutLastExtension(dep); + } + std::string libPath = dep + "_CMAKE_PATH"; + const char* cacheValue = m_Makefile->GetDefinition(libPath.c_str()); + if (!cacheValue) + { + fout << this->ConvertToXMLOutputPath(d->c_str()) + << ";"; + } } fout << "\"\n"; fout << "\t\t\t\t\tOutputs=\""; -- cgit v0.12