diff options
author | Ken Martin <ken.martin@kitware.com> | 2004-06-09 22:56:00 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2004-06-09 22:56:00 (GMT) |
commit | 94847d0aa74a0964a461f9f42d319815fb30becf (patch) | |
tree | 6975995ee47e876bf8c06b9da305a8b22b987b47 | |
parent | 4b55ff77491b5dfcaa6ca02a266a7c5084f7ec59 (diff) | |
download | CMake-94847d0aa74a0964a461f9f42d319815fb30becf.zip CMake-94847d0aa74a0964a461f9f42d319815fb30becf.tar.gz CMake-94847d0aa74a0964a461f9f42d319815fb30becf.tar.bz2 |
BUG#891: When building CMake itself, use the new cmake to install so that the current cmake can be overwritten.
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator.cxx | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx index a6aaaf9..b34fab7 100644 --- a/Source/cmLocalUnixMakefileGenerator.cxx +++ b/Source/cmLocalUnixMakefileGenerator.cxx @@ -2692,8 +2692,21 @@ void cmLocalUnixMakefileGenerator::OutputMakeRules(std::ostream& fout) "", cmd.c_str()); } - this->OutputMakeRule(fout, "installation", "install", "", - "$(CMAKE_COMMAND) -P cmake_install.cmake"); + if(m_Makefile->GetDefinition("CMake_BINARY_DIR")) + { + // We are building CMake itself. We cannot use the original + // executable to install over itself. + std::string rule = m_Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH"); + rule += "/cmake"; + rule = cmSystemTools::ConvertToOutputPath(rule.c_str()); + rule += " -P cmake_install.cmake"; + this->OutputMakeRule(fout, "installation", "install", "", rule.c_str()); + } + else + { + this->OutputMakeRule(fout, "installation", "install", "", + "$(CMAKE_COMMAND) -P cmake_install.cmake"); + } } |