1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-23 18:08:31 +08:00

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.
This commit is contained in:
Stephen Kelly
2016-10-04 22:56:30 +02:00
parent c3264f48c2
commit d5911ef014

View File

@@ -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)