View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015840CMakeCPackpublic2015-11-10 08:312016-06-10 14:31
ReporterMark Stijnman 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product VersionCMake 3.3.2 
Target VersionFixed in Version 
Summary0015840: CPack unspecified behavior for same file in multiple components
DescriptionIn component-based installs, if two components contain the same file, installing to the same destination, CPack has unspecified behavior. For example, the archive generators support it, the WiX generator doesn't.

A common use case could be two executables in separate components, who each include the same DLL in their component.

According to https://cmake.org/Wiki/CMake:Component_Install_With_CPack, [^] under "Rules", it says: "1. An object cannot belong to several COMPONENT". But clearly, several generators allow it anyway. Either this "rule 1" should be enforced in all generators equally, or should be relaxed (and then work for all generators).
Steps To ReproduceUse the attached CMakeLists.txt, which defines two components, which both install a unique file, as well as the same common file. Run cmake and cpack. The ZIP file generation works, and contains the expected 3 files. The WiX generator fails. (This example needs WiX to run)
Additional InformationStrictly enforcing rule 1 should not block the use case of shared files, as another way to handle this would be to define a separate component for the shared files, and set a dependency between any component that requires it. You could even argue that this is the preferred way anyway.

Enforcement of rule 1 should be done in the generator base class. The error message should probably mention the above strategy as a possible solution.

If this rule 1 is going to be strictly enforced, this will break projects that already rely on this unspecified behavior, so in that case a new policy should be introduced. Documentation of the policy should also mention the strategy above.

If it is decided to relax rule 1 instead, keep in mind that this is only well defined if two files from separate components but with the same destination are indeed identical. If not, this should be considered an error, and the CPack generator base class should check for this.
TagsNo tags attached.
Attached Filestxt file icon CMakeLists.txt [^] (286 bytes) 2015-11-10 08:31 [Show Content]

 Relationships

  Notes
(0042884)
Kitware Robot (administrator)
2016-06-10 14:29

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2015-11-10 08:31 Mark Stijnman New Issue
2015-11-10 08:31 Mark Stijnman File Added: CMakeLists.txt
2016-06-10 14:29 Kitware Robot Note Added: 0042884
2016-06-10 14:29 Kitware Robot Status new => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team