CPack/WiX: Allow multiple empty top-level components

Avoid generating empty / conflicting directory components for
the installation root which is shared across components and
(except for the degenerate case of an empty installer)
will always be created implicitly.
This commit is contained in:
Nils Gladitz committed 2025-09-11 15:18:50 +02:00
1 parent 50e5040cda
commit 6e3f6e925d
4 files changed
+11

No files matched your search

+4
View File
@@ -1015,6 +1015,10 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitions(
if (emptyDirectory) {
createDirectory = true;
if (directoryId == "INSTALL_ROOT") {
return;
}
}
if (directoryInstalledFile) {
@@ -3,6 +3,8 @@ CPack: Install projects
CPack: - Install project: CPackWiXGenerator \[Release\]
CPack: - Install component: applications
CPack: - Install component: applications2
CPack: - Install component: empty1
CPack: - Install component: empty2
CPack: - Install component: extras
CPack: - Install component: headers
CPack: - Install component: libraries
@@ -3,6 +3,8 @@ CPack: Install projects
CPack: - Install project: CPackWiXGenerator \[Release\]
CPack: - Install component: applications
CPack: - Install component: applications2
CPack: - Install component: empty1
CPack: - Install component: empty2
CPack: - Install component: extras
CPack: - Install component: headers
CPack: - Install component: libraries
@@ -33,6 +33,9 @@ install(FILES mylib.h "file with spaces.h"
DESTINATION include
COMPONENT headers)
install(CODE "" COMPONENT "empty1")
install(CODE "" COMPONENT "empty2")
set(CPACK_GENERATOR "WIX")
set(CPACK_PACKAGE_NAME "MyLib")