cmake --help-command GET_FILENAME_COMPONENT<div><br></div><div>You have the variable name and the input reversed. Try this:</div><div><div>GET_FILENAME_COMPONENT(dirname &quot;c:/path/to/dir&quot; NAME)</div><div><br></div>
<div><br></div><br><div class="gmail_quote">On Thu, Feb 5, 2009 at 12:38 PM, Ashutosh Juneja <span dir="ltr">&lt;<a href="mailto:ashutosh.juneja@gmail.com">ashutosh.juneja@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>Hi,</div>
<div>&nbsp;</div>
<div>I am&nbsp;unable to fetch only directory name from an absolute path in CMakeList.txt file.</div>
<div>&nbsp;</div>
<div>GET_FILENAME_COMPONENT(c:/path/to/dir dirname NAME) does no produce any output.</div>
<div>&nbsp;</div>
<div>1. Is it only for files or not directories? or am I&nbsp;doing any mistake?</div>
<div>2. Is it possible to split a path in an list/array? ( like extract &#39;abc&#39; and &#39;def&#39; from /path/to/split/abc/and/def )</div>
<div>&nbsp;</div>
<div>Thanks in advance.</div>
<div>Ashutosh</div>
<br>_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org">CMake@cmake.org</a><br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br></div>