[CMake] WIX installer fails for shared files

Nils Gladitz nilsgladitz at gmail.com
Mon Nov 9 10:09:12 EST 2015


On 11/06/2015 08:06 PM, Mark Stijnman wrote:
>
> install(FILES 1.txt common.txt DESTINATION bin COMPONENT comp1)
> install(FILES 2.txt common.txt DESTINATION bin COMPONENT comp2)
>

CMake does not implement any diagnostics that would prevent you from 
doing so but installing distinct files (or even the same file multiple 
times) to the same destination path is ill defined irregardless of it 
being in the same or distinct components.

>
> A partial workaround is to put shared files in a separate, hidden 
> CPack component/WIX feature, and set component dependencies. However, 
> with many shared DLLs, maintaining this gets complex really fast, so 
> I'd rather not have to do this.

I think from CPack's point of view this is the proper thing to do.

>
> As an aside, is it really necessary to have separate staging folders 
> for each component? It should be safe to just have one staging folder, 
> unless two components in the same package install two different files 
> to the same destination - but shouldn't that be an error that CPack 
> should check for anyway?

The (default) installation logic itself is implemented by cmake 
(cmake_install.cmake) and external to CPack.

All the information CPack has available has to come from 
CPackConfig.cmake (+ files included from it) and what CPack finds in the 
staging areas after performing the installations.
This includes only a subset of the information available to cmake.

If installation were performed into a shared staging area CPack would 
not as easily be able to tell which file belongs to which component.

Nils


More information about the CMake mailing list