diff options
author | Brad King <brad.king@kitware.com> | 2001-07-02 20:52:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2001-07-02 20:52:56 (GMT) |
commit | d9e7be545f449db384e6e0193a7906e6139acb9c (patch) | |
tree | 425d0d42a6dab1fb6493e0e3e7fc7d576501bf8e | |
parent | c453f2fc7ae665f584124617c080bc8906f6bf06 (diff) | |
download | CMake-d9e7be545f449db384e6e0193a7906e6139acb9c.zip CMake-d9e7be545f449db384e6e0193a7906e6139acb9c.tar.gz CMake-d9e7be545f449db384e6e0193a7906e6139acb9c.tar.bz2 |
BUG: When outputting relative path of .o, the relative path of the source file must also be written (not full path).
-rw-r--r-- | Source/cmUnixMakefileGenerator.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx index d21acc1..3bcd3ba 100644 --- a/Source/cmUnixMakefileGenerator.cxx +++ b/Source/cmUnixMakefileGenerator.cxx @@ -1158,6 +1158,7 @@ void cmUnixMakefileGenerator::OutputMakeRules(std::ostream& fout) if(!source->IsAHeaderFileOnly()) { std::string shortName; + std::string sourceName; // If the full path to the source file includes this // directory, we want to use the relative path for the // filename of the object file. Otherwise, we will use just @@ -1165,6 +1166,7 @@ void cmUnixMakefileGenerator::OutputMakeRules(std::ostream& fout) if((cmSystemTools::GetFilenamePath(source->GetFullPath()).find(m_Makefile->GetCurrentDirectory()) == 0) || (cmSystemTools::GetFilenamePath(source->GetFullPath()).find(m_Makefile->GetCurrentOutputDirectory()) == 0)) { + sourceName = source->GetSourceName()+"."+source->GetSourceExtension(); shortName = source->GetSourceName(); // The path may be relative. See if a directory needs to be @@ -1181,13 +1183,14 @@ void cmUnixMakefileGenerator::OutputMakeRules(std::ostream& fout) } else { + sourceName = source->GetFullPath(); shortName = cmSystemTools::GetFilenameName(source->GetSourceName()); } // Only output a rule for each .o once. if(rules.find(shortName) == rules.end()) { rules.insert(shortName); - fout << shortName.c_str() << ".o : " << source->GetFullPath() << "\n"; + fout << shortName.c_str() << ".o : " << sourceName.c_str() << "\n"; std::string ext = source->GetSourceExtension(); if ( ext == "cxx" || ext == "cc" || ext == "cpp" || ext == "C" ) { |