ENH: When installing project, write manifest

This commit is contained in:
Andy Cedilnik 2004-03-28 17:59:46 -05:00
parent 747e67b7e3
commit 99feab3528
2 changed files with 27 additions and 0 deletions

View File

@ -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;
}

View File

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