Yes so I did find the string regexp functions and the following seems to be working for me.<br><br>For example (in case anyone else sees this thread and finds it helpful) <br><br>SET( FILE_NAME openssl-0.9.8a.tar.gz )<br>STRING(  REGEX REPLACE &quot;[.]gz&quot; &quot;&quot; FILE_NAME_NO_EXT ${FILE_NAME} )<br>
STRING(  REGEX REPLACE &quot;[.]tar&quot; &quot;&quot; FILE_NAME_NO_EXT ${FILE_NAME_NO_EXT} )<br>MESSAGE( STATUS &quot;File name only is ${FILE_NAME_NO_EXT}&quot; )<br><br>Displays the following in the CMake GUI output window<br>
<br>File name only is openssl-0.9.8a<br><br>    STRING(  REGEX REPLACE &quot;.*([.]tar).*&quot; &quot;\\1&quot;  TAR_EXT ${FILE_NAME} )<br>    <br>    STRING(  REGEX REPLACE &quot;.*([.]gz).*&quot; &quot;\\1&quot;  GZ_EXT ${FILE_NAME} )<br>
<br>    MESSAGE( STATUS &quot;File extension is ${TAR_EXT}&quot; )<br>    MESSAGE( STATUS &quot;File extension is ${GZ_EXT}&quot; )<br><br>Outputs:<br><br>File extension is .tar
<p style="margin: 0px; text-indent: 0px;"></p><p style="margin: 0px; text-indent: 0px;">File extension is .gz</p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">So TAR_EXT and GZ_EXT can be tested for and zxvf or xvf can then be used appropriately amd TAR_OPTS set accordingly.</p>
<p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">Thanks,<br></p><br>Brian<br><br><br><div class="gmail_quote">On Wed, Nov 25, 2009 at 3:24 PM, Eric Noulard <span dir="ltr">&lt;<a href="mailto:eric.noulard@gmail.com">eric.noulard@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">2009/11/25 Brian Davis &lt;<a href="mailto:bitminer@gmail.com">bitminer@gmail.com</a>&gt;:<br>

<div class="im">&gt;<br>
&gt; for a given file of the form:<br>
&gt;<br>
&gt; openssl-0.9.8a.tar.gz<br>
&gt;<br>
&gt; I call as an example:<br>
&gt;<br>
&gt;  get_filename_component( TAR_EXT openssl-0.9.8a.tar.gz EXT )<br>
&gt;<br>
&gt; and I get for TAR_EXT<br>
&gt;<br>
&gt; .9.1.tar.gz<br>
<br>
</div>you should be getting: &quot;.9.8a.tar.gz&quot;<br>
but I think it&#39;s a copy/paste typo<br>
<div class="im"><br>
&gt; Which is not quite what I was expecting.<br>
&gt; I was expecting .gz and with successive calls I would get  .tar<br>
&gt;<br>
&gt; Is there a mechanism in CMake for getting the trailing extension?<br>
<br>
</div>With  get_filename_component I don&#39;t think so<br>
but may be you can use some string(xxxx) calls.<br>
example attached.<br>
<font color="#888888"><br>
--<br>
Erk<br>
Membre de l&#39;April - « promouvoir et défendre le logiciel libre » -<br>
<a href="http://www.april.org" target="_blank">http://www.april.org</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Brian J. Davis<br><br>