BUG: Fix jump-over-and-build for missing libraries when the relative path to the library is different between the source and destination of the jump.

This commit is contained in:
Brad King 2004-01-22 10:54:15 -05:00
parent a4aab3b677
commit fad0651d84
2 changed files with 10 additions and 30 deletions

View File

@ -1673,10 +1673,7 @@ void cmLocalUnixMakefileGenerator::OutputDependLibs(std::ostream& fout)
this->OutputBuildTargetInDir(fout, this->OutputBuildTargetInDir(fout,
cacheValue, cacheValue,
library.c_str(), library.c_str(),
libpath.c_str(), libpath.c_str());
m_Makefile->
GetDefinition("LIBRARY_OUTPUT_PATH")
);
} }
// something other than a library... // something other than a library...
else else
@ -1696,10 +1693,7 @@ void cmLocalUnixMakefileGenerator::OutputDependLibs(std::ostream& fout)
this->OutputBuildTargetInDir(fout, this->OutputBuildTargetInDir(fout,
cacheValue, cacheValue,
fullName.c_str(), fullName.c_str(),
exepath.c_str(), exepath.c_str());
m_Makefile->
GetDefinition("EXECUTABLE_OUTPUT_PATH")
);
} }
} }
} }
@ -1708,53 +1702,41 @@ void cmLocalUnixMakefileGenerator::OutputDependLibs(std::ostream& fout)
void cmLocalUnixMakefileGenerator::OutputBuildTargetInDirWindows(std::ostream& fout, void cmLocalUnixMakefileGenerator::OutputBuildTargetInDirWindows(std::ostream& fout,
const char* path, const char* path,
const char* library, const char* library,
const char* fullpath, const char* fullpath)
const char* libOutPath)
{ {
const char* makeTarget = library; std::string jumpBack =
std::string jumpBack =
cmSystemTools::RelativePath(cmSystemTools::GetProgramPath(fullpath).c_str(), cmSystemTools::RelativePath(cmSystemTools::GetProgramPath(fullpath).c_str(),
m_Makefile->GetCurrentOutputDirectory()); m_Makefile->GetCurrentOutputDirectory());
jumpBack = this->ConvertToOutputForExisting(jumpBack.c_str()); jumpBack = this->ConvertToOutputForExisting(jumpBack.c_str());
std::string wpath = this->ConvertToOutputForExisting(path); std::string wpath = this->ConvertToOutputForExisting(path);
std::string wfullpath = this->ConvertToOutputForExisting(fullpath); std::string wfullpath = this->ConvertToOutputForExisting(fullpath);
if(libOutPath && strcmp( libOutPath, "" ) != 0)
{
makeTarget = wfullpath.c_str();
}
fout << wfullpath fout << wfullpath
<< ":\n\tcd " << wpath << "\n" << ":\n\tcd " << wpath << "\n"
<< "\t$(MAKE) -$(MAKEFLAGS) $(MAKESILENT) cmake.depends\n" << "\t$(MAKE) -$(MAKEFLAGS) $(MAKESILENT) cmake.depends\n"
<< "\t$(MAKE) -$(MAKEFLAGS) $(MAKESILENT) cmake.check_depends\n" << "\t$(MAKE) -$(MAKEFLAGS) $(MAKESILENT) cmake.check_depends\n"
<< "\t$(MAKE) -$(MAKEFLAGS) $(MAKESILENT) -f cmake.check_depends\n" << "\t$(MAKE) -$(MAKEFLAGS) $(MAKESILENT) -f cmake.check_depends\n"
<< "\t$(MAKE) $(MAKESILENT) " << makeTarget << "\t$(MAKE) $(MAKESILENT) " << library
<< "\n\tcd " << jumpBack << "\n"; << "\n\tcd " << jumpBack << "\n";
} }
void cmLocalUnixMakefileGenerator::OutputBuildTargetInDir(std::ostream& fout, void cmLocalUnixMakefileGenerator::OutputBuildTargetInDir(std::ostream& fout,
const char* path, const char* path,
const char* library, const char* library,
const char* fullpath, const char* fullpath)
const char* outputPath)
{ {
if(m_WindowsShell) if(m_WindowsShell)
{ {
this->OutputBuildTargetInDirWindows(fout, path, library, fullpath, outputPath); this->OutputBuildTargetInDirWindows(fout, path, library, fullpath);
return; return;
} }
const char* makeTarget = library;
if(outputPath && strcmp( outputPath, "" ) != 0)
{
makeTarget = fullpath;
}
fout << this->ConvertToOutputForExisting(fullpath) fout << this->ConvertToOutputForExisting(fullpath)
<< ":\n\tcd " << this->ConvertToOutputForExisting(path) << ":\n\tcd " << this->ConvertToOutputForExisting(path)
<< "; $(MAKE) $(MAKESILENT) cmake.depends" << "; $(MAKE) $(MAKESILENT) cmake.depends"
<< "; $(MAKE) $(MAKESILENT) cmake.check_depends" << "; $(MAKE) $(MAKESILENT) cmake.check_depends"
<< "; $(MAKE) $(MAKESILENT) -f cmake.check_depends" << "; $(MAKE) $(MAKESILENT) -f cmake.check_depends"
<< "; $(MAKE) $(MAKESILENT) " << "; $(MAKE) $(MAKESILENT) "
<< this->ConvertToRelativeOutputPath(makeTarget) << "\n\n"; << library << "\n\n";
} }

View File

@ -192,13 +192,11 @@ protected:
virtual void OutputBuildTargetInDirWindows(std::ostream& fout, virtual void OutputBuildTargetInDirWindows(std::ostream& fout,
const char* path, const char* path,
const char* library, const char* library,
const char* fullpath, const char* fullpath);
const char* outputPath);
virtual void OutputBuildTargetInDir(std::ostream& fout, virtual void OutputBuildTargetInDir(std::ostream& fout,
const char* path, const char* path,
const char* library, const char* library,
const char* fullpath, const char* fullpath);
const char* outputPath);
///! return true if the two paths are the same ///! return true if the two paths are the same
virtual bool SamePath(const char* path1, const char* path2); virtual bool SamePath(const char* path1, const char* path2);
virtual std::string GetOutputExtension(const char* sourceExtension); virtual std::string GetOutputExtension(const char* sourceExtension);