Commit d5911ef0 authored by Stephen Kelly's avatar Stephen Kelly

Makefiles: Hardcode the relative location of the CMakeCache file

In this context, currentBinDir refers to the CMAKE_BINARY_DIR because it
comes from the first local generator.  GetHomeOutputDirectory is the
same as CMAKE_BINARY_DIR, so the computation here is unnecessary.
parent c3264f48
Pipeline #29740 passed with stage
......@@ -306,16 +306,12 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
// reset lg to the first makefile
lg = static_cast<cmLocalUnixMakefileGenerator3*>(this->LocalGenerators[0]);
// Build the path to the cache file.
std::string cache = this->GetCMakeInstance()->GetHomeOutputDirectory();
cache += "/CMakeCache.txt";
std::string currentBinDir = lg->GetCurrentBinaryDirectory();
// Save the list to the cmake file.
cmakefileStream
<< "# The top level Makefile was generated from the following files:\n"
<< "set(CMAKE_MAKEFILE_DEPENDS\n"
<< " \"" << lg->ConvertToRelativePath(currentBinDir, cache) << "\"\n";
<< " \"CMakeCache.txt\"\n";
for (std::vector<std::string>::const_iterator i = lfiles.begin();
i != lfiles.end(); ++i) {
cmakefileStream << " \"" << lg->ConvertToRelativePath(currentBinDir, *i)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment