The following issue has been SUBMITTED. 
====================================================================== 
https://public.kitware.com/Bug/view.php?id=15840 
====================================================================== 
Reported By:                Mark Stijnman
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15840
Category:                   CPack
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2015-11-10 08:31 EST
Last Modified:              2015-11-10 08:31 EST
====================================================================== 
Summary:                    CPack unspecified behavior for same file in multiple
components
Description: 
In 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 Reproduce: 
Use 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 Information: 
Strictly 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. 
====================================================================== 

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                    
======================================================================

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to