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

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

Reply via email to