CPackWIX: support installation of empty directories
This commit is contained in:
parent
378eb5b712
commit
642fa25da0
@ -814,6 +814,16 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons(
|
|||||||
cmsys::Directory dir;
|
cmsys::Directory dir;
|
||||||
dir.Load(topdir.c_str());
|
dir.Load(topdir.c_str());
|
||||||
|
|
||||||
|
if(dir.GetNumberOfFiles() == 2)
|
||||||
|
{
|
||||||
|
std::string componentId = fileDefinitions.EmitComponentCreateFolder(
|
||||||
|
directoryId, GenerateGUID());
|
||||||
|
|
||||||
|
featureDefinitions.EmitComponentRef(componentId);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for(size_t i = 0; i < dir.GetNumberOfFiles(); ++i)
|
for(size_t i = 0; i < dir.GetNumberOfFiles(); ++i)
|
||||||
{
|
{
|
||||||
std::string fileName = dir.GetFile(static_cast<unsigned long>(i));
|
std::string fileName = dir.GetFile(static_cast<unsigned long>(i));
|
||||||
|
@ -109,6 +109,28 @@ void cmWIXFilesSourceWriter::EmitUninstallShortcut(
|
|||||||
EndElement("Shortcut");
|
EndElement("Shortcut");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string cmWIXFilesSourceWriter::EmitComponentCreateFolder(
|
||||||
|
std::string const& directoryId, std::string const& guid)
|
||||||
|
{
|
||||||
|
std::string componentId =
|
||||||
|
std::string("CM_C_EMPTY_") + directoryId;
|
||||||
|
|
||||||
|
BeginElement("DirectoryRef");
|
||||||
|
AddAttribute("Id", directoryId);
|
||||||
|
|
||||||
|
BeginElement("Component");
|
||||||
|
AddAttribute("Id", componentId);
|
||||||
|
AddAttribute("Guid", guid);
|
||||||
|
|
||||||
|
BeginElement("CreateFolder");
|
||||||
|
|
||||||
|
EndElement("CreateFolder");
|
||||||
|
EndElement("Component");
|
||||||
|
EndElement("DirectoryRef");
|
||||||
|
|
||||||
|
return componentId;
|
||||||
|
}
|
||||||
|
|
||||||
std::string cmWIXFilesSourceWriter::EmitComponentFile(
|
std::string cmWIXFilesSourceWriter::EmitComponentFile(
|
||||||
std::string const& directoryId,
|
std::string const& directoryId,
|
||||||
std::string const& id,
|
std::string const& id,
|
||||||
|
@ -45,6 +45,10 @@ public:
|
|||||||
|
|
||||||
void EmitUninstallShortcut(std::string const& packageName);
|
void EmitUninstallShortcut(std::string const& packageName);
|
||||||
|
|
||||||
|
std::string EmitComponentCreateFolder(
|
||||||
|
std::string const& directoryId,
|
||||||
|
std::string const& guid);
|
||||||
|
|
||||||
std::string EmitComponentFile(
|
std::string EmitComponentFile(
|
||||||
std::string const& directoryId,
|
std::string const& directoryId,
|
||||||
std::string const& id,
|
std::string const& id,
|
||||||
|
@ -9,6 +9,11 @@ target_link_libraries(my-libapp mylib)
|
|||||||
|
|
||||||
add_executable(my-other-app myotherapp.cpp)
|
add_executable(my-other-app myotherapp.cpp)
|
||||||
|
|
||||||
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/empty)
|
||||||
|
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/empty
|
||||||
|
DESTINATION extras
|
||||||
|
COMPONENT extras)
|
||||||
|
|
||||||
install(TARGETS mylib
|
install(TARGETS mylib
|
||||||
ARCHIVE
|
ARCHIVE
|
||||||
DESTINATION lib
|
DESTINATION lib
|
||||||
@ -72,6 +77,12 @@ cpack_add_component_group(Development
|
|||||||
EXPANDED
|
EXPANDED
|
||||||
DESCRIPTION "All of the tools you'll ever need to develop software")
|
DESCRIPTION "All of the tools you'll ever need to develop software")
|
||||||
|
|
||||||
|
cpack_add_component(extras
|
||||||
|
DISPLAY_NAME "Extras"
|
||||||
|
DESCRIPTION "Extras"
|
||||||
|
GROUP Runtime
|
||||||
|
INSTALL_TYPES Full)
|
||||||
|
|
||||||
cpack_add_component(applications
|
cpack_add_component(applications
|
||||||
REQUIRED
|
REQUIRED
|
||||||
DISPLAY_NAME "MyLib Application"
|
DISPLAY_NAME "MyLib Application"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user