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

Cedric Doucet cedric.doucet at inria.fr
Sat Apr 18 07:00:28 EDT 2015


Hello David,

thank you very much.
Unfortunately, I get the following error message if I remove my download command:

-- downloading...
     src='http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz'
     dst='/home/cdoucet/Downloads/eigen/download/3.2.4.tar.gz'
     timeout='none'
-- [download 100% complete]
CMake Error at src/eigen-stamp/download-eigen.cmake:27 (message):
  error: downloading 'http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz'
  failed

    status_code: 1
    status_string: "Unsupported protocol"
    log: Hostname was NOT found in DNS cache
    Trying 131.103.20.167...

  Connected to bitbucket.org (131.103.20.167) port 80 (#0)

  GET /eigen/eigen/get/3.2.4.tar.gz HTTP/1.1

  User-Agent: curl/7.38.0

  Host: bitbucket.org

  Accept: */*

  

  HTTP/1.1 301 Moved Permanently

  Server nginx/1.6.2 is not blacklisted

  Server: nginx/1.6.2

  Date: Sat, 18 Apr 2015 10:55:20 GMT

  Content-Type: text/html

  Content-Length: 184

  Location: https://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz

  

  Ignoring the response-body

  <html>

  <head><title>301 Moved Permanently</title></head>

  <body bgcolor="white">

  <center><h1>301 Moved Permanently</h1></center>

  <hr><center>nginx/1.6.2</center>

  </body>

  </html>

  Connection #0 to host bitbucket.org left intact

  Issue another request to this URL:
  'https://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz'

  Protocol "https" not supported or disabled in libcurl

  Closing connection -1




----- Mail original -----
> De: "David Cole" <DLRdave at aol.com>
> À: "Cedric Doucet" <cedric.doucet at inria.fr>
> Cc: cmake at cmake.org
> Envoyé: Vendredi 17 Avril 2015 13:21:08
> Objet: Re: [CMake] Don't download external projects again after calling "make clean"
> 
> Eliminate your DOWNLOAD_COMMAND. CMake knows how to do it with just
> the URL_MD5, DOWNLOAD_DIR and SOURCE_DIR information....
> 
> HTH,
> David
> 
> 
> On Fri, Apr 17, 2015 at 1:32 AM, Cedric Doucet <cedric.doucet at inria.fr>
> wrote:
> >
> > Hello David,
> >
> > thank you very much for your help.
> >
> > Unfortunately I may do something wrong because it does not work.
> > After cleaning, the library is downloaded again.
> >
> > I guess my mistake comes from the fact I do not understand the role of
> > URL_MD5.
> > Below is a simple example where downloading and installing is very fast.
> > You just have to replace the value of EXTERNAL_DIR by the path to your own
> > "Downloads" repository.
> > I tried to put URL in my DOWNLOAD_COMMAND but the call "wget <URL>" does
> > not seem to be understood by the wget command.
> >
> > Thanks again!
> >
> > Cédric
> >
> > --------------------------------------------------------------------------
> > cmake_minimum_required (VERSION 2.6)
> >
> > project (example CXX)
> >
> > set(CMAKE_VERBOSE_MAKEFILE ON)
> >
> > include(ProcessorCount)
> > ProcessorCount(N)
> > if(NOT N EQUAL 0)
> >   set(CMAKE_BUILD_FLAGS -j${N})
> > endif()
> >
> > include(ExternalProject)
> > set(EXTERNAL_DIR /home/cdoucet/Downloads)
> > ExternalProject_Add(eigen
> >                     PREFIX ${EXTERNAL_DIR}/eigen
> >                     DOWNLOAD_DIR ${EXTERNAL_DIR}/eigen/download
> >                     SOURCE_DIR ${EXTERNAL_DIR}/eigen/src
> >                     BINARY_DIR ${EXTERNAL_DIR}/eigen/build
> >                     INSTALL_DIR ${EXTERNAL_DIR}/eigen/install
> >                     URL http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz
> >                     URL_MD5 ccb18a771f678b38a3d33c321a8e7daf
> >                     DOWNLOAD_COMMAND wget
> >                     http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz &&
> >                     tar xvzf 3.2.4.tar.gz -C <SOURCE_DIR>
> >                     --strip-components=1
> >                     CONFIGURE_COMMAND cd <BINARY_DIR> && cmake -D
> >                     CMAKE_INSTALL_PREFIX=$<INSTALL_DIR> <SOURCE_DIR>
> >                    )
> > ------------------------------------------------------------------------------
> >
> >
> >
> > ----- Mail original -----
> >> De: "David Cole" <DLRdave at aol.com>
> >> À: "Cedric Doucet" <cedric.doucet at inria.fr>
> >> Cc: cmake at cmake.org
> >> Envoyé: Lundi 13 Avril 2015 12:40:34
> >> Objet: Re: [CMake] Don't download external projects again after calling
> >> "make clean"
> >>
> >> 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