[CMake] Don't download external projects again after calling "make clean"

David Cole DLRdave at aol.com
Mon Apr 13 06:40:34 EDT 2015


Use the URL_MD5 and DOWNLOAD_DIR arguments to ExternalProject_Add to
put the downloaded files into a location outside the build tree
(perhaps ~/Downloads on Mac/Linux or $ENV{USERPROFILE}/Downloads on
Windows).

With DOWNLOAD_DIR outside the build tree, and the checksums of the
downloaded files being the same as you've specified via URL_MD5, the
download portion will be avoided once there is a local copy of a file
available.


HTH,
David C.


On Mon, Apr 13, 2015 at 5:04 AM, Cedric Doucet <cedric.doucet at inria.fr> wrote:
>
> Hello!
>
> I use the ExternalProject_Add function to download third-party libraries of
> a code.
>
> Once a library has been downloaded, I can call "make" as many times as I
> want without downloading this library again.
> It seems that CMake detects that the library has already been downloaded.
>
> However, calling "make clean" seems to destroy this feature.
> Even if my library is not uninstalled during cleaning, calling "make" after
> "make clean" will lead CMake to try download the library again.
>
> How could I tell CMake not to download the library again?
>
> Thank you very much for your help!
>
> Cédric
>
> --
>
> 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


More information about the CMake mailing list