No token <DOWNLOAD_DIR> in ExternalProject

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

No token <DOWNLOAD_DIR> in ExternalProject

cmake
Hello all,
 
I'm surprised that there is no token <DOWNLOAD_DIR> available in ExternalProject.
 
As written in the documentation [1] there are tokens <SOURCE_DIR>, <SOURCE_SUBDIR>, <BINARY_DIR>, <INSTALL_DIR>, and <TMP_DIR>. But <DOWNLOAD_DIR> seems to be missing. 
 
However if I have an external project with a custom DOWNLOAD_COMMAND it would be handy to be able to use <DOWNLOAD_DIR> in the following steps.
 
Is there another way to know the download directory without setting it explicitely? 
 
Best,
Bjorn
 
 

--

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 | Threaded
Open this post in threaded view
|

Re: No token <DOWNLOAD_DIR> in ExternalProject

Craig Scott-3


On Mon, Nov 27, 2017 at 10:22 PM, <[hidden email]> wrote:
Hello all,
 
I'm surprised that there is no token <DOWNLOAD_DIR> available in ExternalProject.
 
As written in the documentation [1] there are tokens <SOURCE_DIR>, <SOURCE_SUBDIR>, <BINARY_DIR>, <INSTALL_DIR>, and <TMP_DIR>. But <DOWNLOAD_DIR> seems to be missing. 

The relevant part of the module code is here. It does seem to be an unexpected omission, but I don't know if there's a reason for it or not.


 
 
However if I have an external project with a custom DOWNLOAD_COMMAND it would be handy to be able to use <DOWNLOAD_DIR> in the following steps.
 
Is there another way to know the download directory without setting it explicitely? 

You can retrieve it with ExternalProject_Get_Property(myExtProj DOWNLOAD_DIR), which will store the result in a variable also named DOWNLOAD_DIR. That's a bit tricky though, since you can only call that after you've defined the download command in your ExternalProject_Add() call. You could define a custom step in a subsequent call and perhaps set up dependencies between steps to get the behaviour you want, but it does seem unnecessarily fiddly.




--
Craig Scott
Melbourne, Australia

--

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 | Threaded
Open this post in threaded view
|

Re: No token <DOWNLOAD_DIR> in ExternalProject

cmake
Thanks for the link and the suggestion. The latter is similar to one of the things I've tried - splitting the external project into two external projects with one just managing the download. It seemed like a workaround for something which I expected to be an usual use case. Hence I thought I might be missing something. This doesn’t seem to be the case, so I’ll submit a feature request to add a token <DOWNLOAD_DIR>.

Thanks again,
Bjorn

> On 27. Nov 2017, at 13:12, Craig Scott <[hidden email]> wrote:
>
>
>
> On Mon, Nov 27, 2017 at 10:22 PM, <[hidden email]> wrote:
> Hello all,
>  
> I'm surprised that there is no token <DOWNLOAD_DIR> available in ExternalProject.
>  
> As written in the documentation [1] there are tokens <SOURCE_DIR>, <SOURCE_SUBDIR>, <BINARY_DIR>, <INSTALL_DIR>, and <TMP_DIR>. But <DOWNLOAD_DIR> seems to be missing.
>
> The relevant part of the module code is here. It does seem to be an unexpected omission, but I don't know if there's a reason for it or not.
>
>
>  
>  
> However if I have an external project with a custom DOWNLOAD_COMMAND it would be handy to be able to use <DOWNLOAD_DIR> in the following steps.
>  
> Is there another way to know the download directory without setting it explicitely?
>
> You can retrieve it with ExternalProject_Get_Property(myExtProj DOWNLOAD_DIR), which will store the result in a variable also named DOWNLOAD_DIR. That's a bit tricky though, since you can only call that after you've defined the download command in your ExternalProject_Add() call. You could define a custom step in a subsequent call and perhaps set up dependencies between steps to get the behaviour you want, but it does seem unnecessarily fiddly.
>
>
>
>
> --
> 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