diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmFileCommand.cxx | 11 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 16 |
2 files changed, 27 insertions, 0 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 18489cc..04608b5 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -414,6 +414,14 @@ bool cmFileCommand::HandleInstallCommand( return false; } + const char* manifest_files = + m_Makefile->GetDefinition("CMAKE_INSTALL_MANIFEST_FILES"); + std::string smanifest_files; + if ( manifest_files ) + { + smanifest_files = manifest_files; + } + for ( i = 0; i < files.size(); i ++ ) { std::string destfile @@ -475,6 +483,7 @@ bool cmFileCommand::HandleInstallCommand( { perror("problem doing chmod."); } + smanifest_files += ";" + destfile; } } else @@ -488,6 +497,8 @@ bool cmFileCommand::HandleInstallCommand( } } } + m_Makefile->AddDefinition("CMAKE_INSTALL_MANIFEST_FILES", + smanifest_files.c_str()); return true; } diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index b5638d5..27f240d 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -77,7 +77,16 @@ void cmLocalGenerator::GenerateInstallRules() } std::string file = m_Makefile->GetStartOutputDirectory(); + std::string homedir = m_Makefile->GetHomeOutputDirectory(); + std::string currdir = m_Makefile->GetCurrentOutputDirectory(); cmSystemTools::ConvertToUnixSlashes(file); + cmSystemTools::ConvertToUnixSlashes(homedir); + cmSystemTools::ConvertToUnixSlashes(currdir); + int toplevel_install = 0; + if ( currdir == homedir ) + { + toplevel_install = 1; + } file += "/cmake_install.cmake"; cmGeneratedFileStream tempFile(file.c_str()); std::ostream& fout = tempFile.GetStream(); @@ -254,6 +263,13 @@ void cmLocalGenerator::GenerateInstallRules() } fout << std::endl;; } + if ( toplevel_install ) + { + fout << "FOREACH(file ${CMAKE_INSTALL_MANIFEST_FILES})" << std::endl + << " FILE(APPEND \"" << homedir.c_str() << "/install_manifest.txt\" " + << "\"${file}\\n\")" << std::endl + << "ENDFOREACH(file)" << std::endl; + } } void cmLocalGenerator::AddInstallRule(std::ostream& fout, const char* dest, |