mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-24 11:32:44 +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:
@@ -306,16 +306,12 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
|
|||||||
// reset lg to the first makefile
|
// reset lg to the first makefile
|
||||||
lg = static_cast<cmLocalUnixMakefileGenerator3*>(this->LocalGenerators[0]);
|
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();
|
std::string currentBinDir = lg->GetCurrentBinaryDirectory();
|
||||||
// Save the list to the cmake file.
|
// Save the list to the cmake file.
|
||||||
cmakefileStream
|
cmakefileStream
|
||||||
<< "# The top level Makefile was generated from the following files:\n"
|
<< "# The top level Makefile was generated from the following files:\n"
|
||||||
<< "set(CMAKE_MAKEFILE_DEPENDS\n"
|
<< "set(CMAKE_MAKEFILE_DEPENDS\n"
|
||||||
<< " \"" << lg->ConvertToRelativePath(currentBinDir, cache) << "\"\n";
|
<< " \"CMakeCache.txt\"\n";
|
||||||
for (std::vector<std::string>::const_iterator i = lfiles.begin();
|
for (std::vector<std::string>::const_iterator i = lfiles.begin();
|
||||||
i != lfiles.end(); ++i) {
|
i != lfiles.end(); ++i) {
|
||||||
cmakefileStream << " \"" << lg->ConvertToRelativePath(currentBinDir, *i)
|
cmakefileStream << " \"" << lg->ConvertToRelativePath(currentBinDir, *i)
|
||||||
|
|||||||
Reference in New Issue
Block a user