diff options
author | Nils Gladitz <nilsgladitz@gmail.com> | 2014-09-27 15:34:39 (GMT) |
---|---|---|
committer | Nils Gladitz <nilsgladitz@gmail.com> | 2014-09-27 15:34:39 (GMT) |
commit | d48c781fc2e637fd9605775f44f4360bec6a59d9 (patch) | |
tree | 08a190d00835a9fb230fcf3dae6956b19dffabc4 /Source/CPack/WiX/cmCPackWIXGenerator.cxx | |
parent | 58dc05de9e8e130b0fc188ff510826d649d62aff (diff) | |
download | CMake-d48c781fc2e637fd9605775f44f4360bec6a59d9.zip CMake-d48c781fc2e637fd9605775f44f4360bec6a59d9.tar.gz CMake-d48c781fc2e637fd9605775f44f4360bec6a59d9.tar.bz2 |
CPackWiX: Extend CPACK_WIX_ACL to support directories
Diffstat (limited to 'Source/CPack/WiX/cmCPackWIXGenerator.cxx')
-rw-r--r-- | Source/CPack/WiX/cmCPackWIXGenerator.cxx | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index b221ab4..744280a 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -847,13 +847,37 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons( cmsys::Directory dir; dir.Load(topdir.c_str()); - if(dir.GetNumberOfFiles() == 2) + std::string relativeDirectoryPath = + cmSystemTools::RelativePath(toplevel.c_str(), topdir.c_str()); + + cmInstalledFile const* directoryInstalledFile = + this->GetInstalledFile(relativeDirectoryPath); + + bool emptyDirectory = dir.GetNumberOfFiles() == 2; + bool createDirectory = false; + + if(emptyDirectory) { - std::string componentId = fileDefinitions.EmitComponentCreateFolder( - directoryId, GenerateGUID()); + createDirectory = true; + } + + if(directoryInstalledFile) + { + if(directoryInstalledFile->HasProperty("CPACK_WIX_ACL")) + { + createDirectory = true; + } + } + if(createDirectory) + { + std::string componentId = fileDefinitions.EmitComponentCreateFolder( + directoryId, GenerateGUID(), directoryInstalledFile); featureDefinitions.EmitComponentRef(componentId); + } + if(emptyDirectory) + { return; } |