diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-03-28 22:59:46 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-03-28 22:59:46 (GMT) |
commit | 99feab3528325833033c32675adc9c2b138cd6ac (patch) | |
tree | c36f04e9e5b3e0a3c114f754832699e00cb354a8 /Source | |
parent | 747e67b7e358d86e7677cd4436a560f545d19dc2 (diff) | |
download | CMake-99feab3528325833033c32675adc9c2b138cd6ac.zip CMake-99feab3528325833033c32675adc9c2b138cd6ac.tar.gz CMake-99feab3528325833033c32675adc9c2b138cd6ac.tar.bz2 |
ENH: When installing project, write manifest
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, |