[cmake-developers] [patch] One more pattern for extracting file name from URL

Ruslan Baratov ruslan_baratov at yahoo.com
Tue Jul 5 16:13:52 EDT 2016


On 05-Jul-16 22:03, Brad King wrote:
> On 07/01/2016 03:35 PM, Brad King wrote:
>> I don't think we should duplicate the
>>
>>    "(\\.|=)(7z|tar|tar\\.bz2|tar\\.gz|tar\\.xz|tbz2|tgz|txz|zip)$"
>>
>> expression.  The stripping of ?.* can be done earlier, or done as
>> part of the main match.
> Please try this commit:
>
>   ExternalProject: Match filenames in URLs with query strings and anchors
>   https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=57c337e2
>
> Thanks,
> -Brad
>
Works fine on my tests. However I still vote for using default value for 
'fname' instead of FATAL_ERROR. If something bad will happen user always 
can use DOWNLOAD_NAME.

Example of the test that will fail with current version but works fine 
with default name:

    cmake_minimum_required(VERSION 3.5)

    include(ExternalProject)

    ExternalProject_Add(
         foo
         URL "http://tinyurl.com/jn86pmc"
         URL_HASH SHA1=9c29c30fff99b7c1479b2e9d4926dcc3f8d364e0
         CONFIGURE_COMMAND ""
         BUILD_COMMAND ""
         INSTALL_COMMAND ""
    )

Ruslo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20160705/ff809fcb/attachment.html>


More information about the cmake-developers mailing list