Devs, Merge request 1306 <https://gitlab.kitware.com/cmake/cmake/merge_requests/1306> implements a new module *DownloadDependency* and this email is to solicit feedback, with a focus on the API the module presents. Brief summary follows so you can get an idea if you're interested in the topic.
The new module provides three functions which together provide facilities for downloading dependencies at configure time rather than at build time. The main motivating case is to allow project dependencies to be downloaded during configure so they can be brought into the build immediately via add_subdirectory() or however the main project wants to make use of the downloaded content (could also be things like certificates, assets, CMake helper modules, etc.). The key feature is that you don't have to wait until build time before the contents are available, so you can do things that would not otherwise be possible with, for example, ExternalProject used in the usual way. Another alternative, the file(DOWNLOAD) command, only supports limited download methods, whereas DownloadProject supports all the methods that ExternalProject_Add() supports (DownloadProject is implemented in terms of ExternalProject_Add() via a sub-build executed via execute_process()). The module conveniently supports project hierarchies and gives parent projects override control over any dependencies that child projects might define. It also facilitates ensuring that a particular dependency is only downloaded once if multiple child projects require it. No central repository of build recipes is required, parent projects are in control of any settings they wish to adjust before pulling in a child dependency via add_subdirectory() or include() or whatever. The module has been evolved in a real-world environment for the past 2 years on complex project hierarchies, with builds across Linux, Windows, Mac and iOS. The module as presented in the merge request is a cleaned up version of that. The three functions provided by the module are: - download_dependency_details() - download_dependency_state() - download_dependency() See the documentation included in the merge request for an explanation of each of these and the overall module. Examples are included in the docs. Your feedback would be welcome. -- Craig Scott Melbourne, Australia https://crascit.com
-- 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