install: Write the entire installation manifest at once
Avoid a separate open/close for each file installed. Use a single file(WRITE) instead of a loop with file(APPEND).
This commit is contained in:
parent
99575c9ac1
commit
c48141744e
|
@ -1906,8 +1906,11 @@ protected:
|
||||||
|
|
||||||
std::string Manifest;
|
std::string Manifest;
|
||||||
void ManifestAppend(std::string const& file)
|
void ManifestAppend(std::string const& file)
|
||||||
|
{
|
||||||
|
if (!this->Manifest.empty())
|
||||||
{
|
{
|
||||||
this->Manifest += ";";
|
this->Manifest += ";";
|
||||||
|
}
|
||||||
this->Manifest += file.substr(this->DestDirLength);
|
this->Manifest += file.substr(this->DestDirLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -535,17 +535,12 @@ void cmLocalGenerator::GenerateInstallRules()
|
||||||
"${CMAKE_INSTALL_COMPONENT}.txt\")\n"
|
"${CMAKE_INSTALL_COMPONENT}.txt\")\n"
|
||||||
"else()\n"
|
"else()\n"
|
||||||
" set(CMAKE_INSTALL_MANIFEST \"install_manifest.txt\")\n"
|
" set(CMAKE_INSTALL_MANIFEST \"install_manifest.txt\")\n"
|
||||||
"endif()\n\n";
|
"endif()\n"
|
||||||
fout
|
"\n"
|
||||||
<< "file(WRITE \""
|
"string(REPLACE \";\" \"\\n\" CMAKE_INSTALL_MANIFEST_CONTENT\n"
|
||||||
<< homedir << "/${CMAKE_INSTALL_MANIFEST}\" "
|
" \"${CMAKE_INSTALL_MANIFEST_FILES}\")\n"
|
||||||
<< "\"\")" << std::endl;
|
"file(WRITE \"" << homedir << "/${CMAKE_INSTALL_MANIFEST}\"\n"
|
||||||
fout
|
" \"${CMAKE_INSTALL_MANIFEST_CONTENT}\")\n";
|
||||||
<< "foreach(file ${CMAKE_INSTALL_MANIFEST_FILES})" << std::endl
|
|
||||||
<< " file(APPEND \""
|
|
||||||
<< homedir << "/${CMAKE_INSTALL_MANIFEST}\" "
|
|
||||||
<< "\"${file}\\n\")" << std::endl
|
|
||||||
<< "endforeach()" << std::endl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue