diff options
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index a76bed3..9b12354 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -177,10 +177,11 @@ void cmLocalGenerator::GenerateTestFiles() } typedef std::vector<cmState::Snapshot> vec_t; vec_t const& children = this->Makefile->GetStateSnapshot().GetChildren(); + std::string parentBinDir = this->GetCurrentBinaryDirectory(); for (vec_t::const_iterator i = children.begin(); i != children.end(); ++i) { // TODO: Use add_subdirectory instead? std::string outP = i->GetDirectory().GetCurrentBinary(); - outP = this->ConvertToRelativePath(outP, START_OUTPUT); + outP = this->ConvertToRelativePath(parentBinDir, outP); outP = cmOutputConverter::EscapeForCMake(outP); fout << "subdirs(" << outP << ")" << std::endl; } @@ -1408,7 +1409,9 @@ std::string cmLocalGenerator::ConvertToLinkReference(std::string const& lib, #endif // Normal behavior. - return this->Convert(lib, START_OUTPUT, format); + return this->ConvertToOutputFormat( + this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), lib), + format); } /** @@ -2242,11 +2245,11 @@ std::string cmLocalGenerator::ConstructComment( std::string comment; comment = "Generating "; const char* sep = ""; + std::string currentBinaryDir = this->GetCurrentBinaryDirectory(); for (std::vector<std::string>::const_iterator o = ccg.GetOutputs().begin(); o != ccg.GetOutputs().end(); ++o) { comment += sep; - comment += - this->ConvertToRelativePath(*o, cmOutputConverter::START_OUTPUT); + comment += this->ConvertToRelativePath(currentBinaryDir, *o); sep = ", "; } return comment; @@ -2514,14 +2517,15 @@ std::string cmLocalGenerator::GetObjectFileNameWithoutTarget( const char* fullPath = source.GetFullPath().c_str(); // Try referencing the source relative to the source tree. - std::string relFromSource = this->ConvertToRelativePath(fullPath, START); + std::string relFromSource = + this->ConvertToRelativePath(this->GetCurrentSourceDirectory(), fullPath); assert(!relFromSource.empty()); bool relSource = !cmSystemTools::FileIsFullPath(relFromSource.c_str()); bool subSource = relSource && relFromSource[0] != '.'; // Try referencing the source relative to the binary tree. std::string relFromBinary = - this->ConvertToRelativePath(fullPath, START_OUTPUT); + this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), fullPath); assert(!relFromBinary.empty()); bool relBinary = !cmSystemTools::FileIsFullPath(relFromBinary.c_str()); bool subBinary = relBinary && relFromBinary[0] != '.'; |