BUG: Fix for issue #7470. Allow spaces in the path names of installed files with the NSIS CPack generator and component-based installs. Add an installed file to the CPackComponents test: it failed before the fix; now it passes.

This commit is contained in:
David Cole 2009-01-20 14:29:41 -05:00
parent 7f92b77997
commit 03c940aeb3
3 changed files with 32 additions and 10 deletions

View File

@ -793,20 +793,25 @@ CreateComponentDescription(cmCPackComponent *component,
macrosOut << " IntCmp $" << component->Name << "_was_installed 0 noremove_" macrosOut << " IntCmp $" << component->Name << "_was_installed 0 noremove_"
<< component->Name << "\n"; << component->Name << "\n";
std::vector<std::string>::iterator pathIt; std::vector<std::string>::iterator pathIt;
std::string path;
for (pathIt = component->Files.begin(); for (pathIt = component->Files.begin();
pathIt != component->Files.end(); pathIt != component->Files.end();
++pathIt) ++pathIt)
{ {
path = *pathIt;
cmSystemTools::ReplaceString(path, "/", "\\");
macrosOut << " Delete \"$INSTDIR\\" macrosOut << " Delete \"$INSTDIR\\"
<< cmSystemTools::ConvertToWindowsOutputPath(pathIt->c_str()) << path.c_str()
<< "\"\n"; << "\"\n";
} }
for (pathIt = component->Directories.begin(); for (pathIt = component->Directories.begin();
pathIt != component->Directories.end(); pathIt != component->Directories.end();
++pathIt) ++pathIt)
{ {
path = *pathIt;
cmSystemTools::ReplaceString(path, "/", "\\");
macrosOut << " RMDir \"$INSTDIR\\" macrosOut << " RMDir \"$INSTDIR\\"
<< cmSystemTools::ConvertToWindowsOutputPath(pathIt->c_str()) << path.c_str()
<< "\"\n"; << "\"\n";
} }
macrosOut << " noremove_" << component->Name << ":\n"; macrosOut << " noremove_" << component->Name << ":\n";

View File

@ -39,6 +39,9 @@ install(TARGETS mylibapp
install(FILES mylib.h install(FILES mylib.h
DESTINATION include DESTINATION include
COMPONENT headers) COMPONENT headers)
install(FILES "Issue 7470.html"
DESTINATION docs
COMPONENT documentation)
if(mylib_install_to_absolute_path) if(mylib_install_to_absolute_path)
install(FILES mylib.cpp install(FILES mylib.cpp
@ -77,6 +80,11 @@ cpack_add_component(applications
DESCRIPTION "An extremely useful application that makes use of MyLib" DESCRIPTION "An extremely useful application that makes use of MyLib"
GROUP Runtime GROUP Runtime
INSTALL_TYPES Full) INSTALL_TYPES Full)
cpack_add_component(documentation
DISPLAY_NAME "MyLib Documentation"
DESCRIPTION "The extensive suite of MyLib Application documentation files"
GROUP Runtime
INSTALL_TYPES Full)
cpack_add_component(libraries cpack_add_component(libraries
DISPLAY_NAME "Libraries" DISPLAY_NAME "Libraries"
DESCRIPTION "Static libraries used to build programs with MyLib" DESCRIPTION "Static libraries used to build programs with MyLib"

View File

@ -0,0 +1,9 @@
<html>
<body>
The install rule for this file demonstrates the problem described in<br/>
CMake issue #7470:<br/>
<br/>
<a href="http://public.kitware.com/Bug/view.php?id=7470">
http://public.kitware.com/Bug/view.php?id=7470</a><br/>
</body>
</html>