Hello,<div><br></div><div>Sorry, the example was wrong (copy & paste from a bad revision). This is the right one:</div><div><br></div><div><pre style="word-wrap:break-word;white-space:pre-wrap">      ExternalProject_Add( graphicsmagick
            DOWNLOAD_NAME graphicsmagick.exe
            DOWNLOAD_DIR ${WINST_BASEDIR}/downloads 
            URL ${graphicsmagick_URL}
            URL_MD5 ${graphicsmagick_MD5}
<b>           EXTRACT_COMMAND <DOWNLOAD_DIR>graphicsmagick.exe /VERYSILENT /NORESTART /DIR=\"${WINST_PREFIX}/bin\" /NOICONS /SP-</b>
            LOG_DOWNLOAD 1
            LOG_UPDATE 1
            LOG_CONFIGURE 1
            LOG_BUILD 1
            LOG_TEST 1
            LOG_INSTALL 1
            )</pre><pre style="word-wrap:break-word;white-space:pre-wrap"><br></pre><br><div class="gmail_quote">On Fri, Jul 12, 2013 at 1:48 AM, Pau Garcia i Quiles <span dir="ltr"><<a href="mailto:pgquiles@elpauer.org" target="_blank">pgquiles@elpauer.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<div><br></div><div>Related to this, I implemented an EXTRACT_COMMAND option to ExternalProject_Add which would enable to download anything, provided that an EXTRACT_COMMAND is also passed so that CMake knows how to extract what it downloaded. It is specially useful for Windows, where NSIS, InstallShield, etc can be extracted silently but they all have the .exe / .msi extension.</div>


<div><br></div><div>It's available from here:</div><div><br></div><div><a href="https://elpauer.assembla.com/code/elpauercmake/git/nodes/epa_extract_command" target="_blank">https://elpauer.assembla.com/code/elpauercmake/git/nodes/epa_extract_command</a></div>


<div><br></div><div>Branch epa_extract_command</div><div><br></div><div>(that clone is a bit outdated, btw)</div><div><br></div><div>It's used like this:</div><div><br></div><div><pre style="word-wrap:break-word;white-space:pre-wrap">

      ExternalProject_Add( graphicsmagick
            DOWNLOAD_NAME graphicsmagick.exe
            DOWNLOAD_DIR ${WINST_BASEDIR}/downloads 
            URL ${graphicsmagick_URL}
            URL_MD5 ${graphicsmagick_MD5}
            <b>EXTRACT_COMMAND ${CMAKE_COMMAND} -E copy ${WINST_BATDIR}/patches/graphicsmagick.exe.manifest ${WINST_PREFIX}/bin/</b>
            LOG_DOWNLOAD 1
            LOG_UPDATE 1
            LOG_CONFIGURE 1
            LOG_BUILD 1
            LOG_TEST 1
            LOG_INSTALL 1
            )</pre><pre style="word-wrap:break-word;white-space:pre-wrap"><br></pre></div><div><div><div class="h5"><br><div class="gmail_quote">On Fri, Jul 12, 2013 at 1:30 AM, Alan W. Irwin <span dir="ltr"><<a href="mailto:irwin@beluga.phys.uvic.ca" target="_blank">irwin@beluga.phys.uvic.ca</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">These commands<br>
<br>
file(DOWNLOAD<br>
"<a href="http://download.gnome.org/sources/glib/2.32/glib-2.32.1.tar.xz" target="_blank">http://download.gnome.org/<u></u>sources/glib/2.32/glib-2.32.1.<u></u>tar.xz</a>"<br>
"/home/software/plplot_svn/<u></u>HEAD/plplot_allura/cmake/<u></u>build_projects/cmake_<u></u>downloaded_glib-2.32.1.tar.xz"<br>
SHOW_PROGRESS STATUS status)<br>
message(STATUS "Download status = ${status}")<br>
<br>
instantly give me the following results:<br>
<br>
-- [download 0% complete]<br>
-- Download status = 1;"unsupported protocol"<br>
<br>
with a zero-length cmake_downloaded_glib-2.32.1.<u></u>tar.xz produced.<br>
<br>
Yet when I use wget to obtain<br>
<a href="http://download.gnome.org/sources/glib/2.32/glib-2.32.1.tar.xz" target="_blank">http://download.gnome.org/<u></u>sources/glib/2.32/glib-2.32.1.<u></u>tar.xz</a> there<br>
are no problems.  i.e.,<br>
<br>
software@raven> wget <a href="http://download.gnome.org/sources/glib/2.32/glib-2.32.1.tar.xz" target="_blank">http://download.gnome.org/<u></u>sources/glib/2.32/glib-2.32.1.<u></u>tar.xz</a><br>
--2013-07-11 16:04:21--  <a href="http://download.gnome.org/sources/glib/2.32/glib-2.32.1.tar.xz" target="_blank">http://download.gnome.org/<u></u>sources/glib/2.32/glib-2.32.1.<u></u>tar.xz</a><br>
Resolving <a href="http://download.gnome.org" target="_blank">download.gnome.org</a> (<a href="http://download.gnome.org" target="_blank">download.gnome.org</a>)... 209.132.180.168, 209.132.180.180<br>
Connecting to <a href="http://download.gnome.org" target="_blank">download.gnome.org</a> (<a href="http://download.gnome.org" target="_blank">download.gnome.org</a>)|209.132.<u></u>180.168|:80... connected.<br>
HTTP request sent, awaiting response... 302 Found<br>
Location: <a href="https://download.gnome.org/sources/glib/2.32/glib-2.32.1.tar.xz" target="_blank">https://download.gnome.org/<u></u>sources/glib/2.32/glib-2.32.1.<u></u>tar.xz</a> [following]<br>
--2013-07-11 16:04:21--  <a href="https://download.gnome.org/sources/glib/2.32/glib-2.32.1.tar.xz" target="_blank">https://download.gnome.org/<u></u>sources/glib/2.32/glib-2.32.1.<u></u>tar.xz</a><br>
Connecting to <a href="http://download.gnome.org" target="_blank">download.gnome.org</a> (<a href="http://download.gnome.org" target="_blank">download.gnome.org</a>)|209.132.<u></u>180.168|:443... connected.<br>
HTTP request sent, awaiting response... 301 Moved Permanently<br>
Location: <a href="http://ftp.gnome.org/pub/GNOME/sources/glib/2.32/glib-2.32.1.tar.xz" target="_blank">http://ftp.gnome.org/pub/<u></u>GNOME/sources/glib/2.32/glib-<u></u>2.32.1.tar.xz</a> [following]<br>
--2013-07-11 16:04:22--  <a href="http://ftp.gnome.org/pub/GNOME/sources/glib/2.32/glib-2.32.1.tar.xz" target="_blank">http://ftp.gnome.org/pub/<u></u>GNOME/sources/glib/2.32/glib-<u></u>2.32.1.tar.xz</a><br>
Resolving <a href="http://ftp.gnome.org" target="_blank">ftp.gnome.org</a> (<a href="http://ftp.gnome.org" target="_blank">ftp.gnome.org</a>)... 130.239.18.137, 130.239.18.138, 130.239.18.163, ...<br>
Connecting to <a href="http://ftp.gnome.org" target="_blank">ftp.gnome.org</a> (<a href="http://ftp.gnome.org" target="_blank">ftp.gnome.org</a>)|130.239.18.<u></u>137|:80... connected.<br>
HTTP request sent, awaiting response... 200 OK<br>
Length: 6138200 (5.9M) [application/x-xz]<br>
Saving to: `glib-2.32.1.tar.xz.1'<br>
<br>
100%[=========================<u></u>==============================<u></u>====================>] 6,138,200    956K/s   in 12s<br>
<br>
2013-07-11 16:04:35 (508 KB/s) - `glib-2.32.1.tar.xz.1' saved [6138200/6138200]<br>
<br>
<br>
If I do the equivalent CMake commands above for some random *.tar.gz<br>
the result was<br>
<br>
-- [download 25% complete]<br>
-- [download 100% complete]<br>
-- Download status = 0;"no error"<br>
<br>
with a full file downloaded.<br>
<br>
So I don't think I have any syntax error in the above CMake logic.<br>
<br>
One explanation is CMake might be having trouble with the http<br>
protocol when there is a tar.xz suffix on the URL.  To check that<br>
hypothesis, I also tried downloading<br>
<a href="http://download.gnome.org/sources/gcr/3.4/gcr-3.4.1.tar.xz" target="_blank">http://download.gnome.org/<u></u>sources/gcr/3.4/gcr-3.4.1.tar.<u></u>xz</a> and got the<br>
same bad status.<br>
<br>
But why should CMake care in the slightest about the tar.xz suffix on the<br>
file that is downloaded?  Shouldn't it just download the file come<br>
hell or high water?<br>
<br>
BTW, I also just discovered that cmake has no trouble unpacking a<br>
*.tar.xz file using, e.g.,<br>
<br>
cmake -E tar xfz glib-2.32.1.tar.xz<br>
<br>
I also found that some small changes had to be made to<br>
ExternalProjects.cmake to allow files of the form *.tar.xz to be<br>
processed further (e.g., by the above cmake -E tar command).  I plan<br>
to submit that patch to your bug tracker.  But aside from that one<br>
issue (fixed with a patch) and the above strange issue with *.tar.xz<br>
files that cannot be downloaded with file(DOWNLOAD), the rest of my<br>
use of ExternalProject.cmake should be okay for build_projects (where<br>
I have discovered that many downloadable source tarballs are in the<br>
*.tar.xz form).<br>
<br>
Alan<br>
__________________________<br>
Alan W. Irwin<br>
<br>
Astronomical research affiliation with Department of Physics and Astronomy,<br>
University of Victoria (<a href="http://astrowww.phys.uvic.ca" target="_blank">astrowww.phys.uvic.ca</a>).<br>
<br>
Programming affiliations with the FreeEOS equation-of-state<br>
implementation for stellar interiors (<a href="http://freeeos.sf.net" target="_blank">freeeos.sf.net</a>); the Time<br>
Ephemerides project (<a href="http://timeephem.sf.net" target="_blank">timeephem.sf.net</a>); PLplot scientific plotting<br>
software package (<a href="http://plplot.sf.net" target="_blank">plplot.sf.net</a>); the libLASi project<br>
(<a href="http://unifont.org/lasi" target="_blank">unifont.org/lasi</a>); the Loads of Linux Links project (<a href="http://loll.sf.net" target="_blank">loll.sf.net</a>);<br>
and the Linux Brochure Project (<a href="http://lbproject.sf.net" target="_blank">lbproject.sf.net</a>).<br>
__________________________<br>
<br>
Linux-powered Science<br>
__________________________<br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/<u></u>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/<u></u>CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers" target="_blank">http://public.kitware.com/cgi-<u></u>bin/mailman/listinfo/cmake-<u></u>developers</a><br>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br>Pau Garcia i Quiles<br><a href="http://www.elpauer.org" target="_blank">http://www.elpauer.org</a><br>(Due to my workload, I may need 10 days to answer)
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Pau Garcia i Quiles<br><a href="http://www.elpauer.org">http://www.elpauer.org</a><br>(Due to my workload, I may need 10 days to answer)
</div>