[cmake-developers] Seeking feedback for new DownloadDependency module

Craig Scott craig.scott at crascit.com
Wed Sep 27 09:31:44 EDT 2017


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20170927/0e7154b3/attachment.html>


More information about the cmake-developers mailing list