Sorry for the very delayed response, but... the following CMake code correctly identifies directories for me on Windows with CMake 2.4:<br>PROJECT(DetectDirectories)<br><br>FILE(GLOB fl &quot;*&quot;)<br><br>FOREACH(f ${fl})
<br>&nbsp; IF(EXISTS &quot;${f}/&quot;)<br>&nbsp;&nbsp;&nbsp; MESSAGE(STATUS &quot;&nbsp; directory: &#39;${f}&#39;&quot;)<br>&nbsp; ELSE(EXISTS &quot;${f}/&quot;)<br>&nbsp;&nbsp;&nbsp; MESSAGE(STATUS &quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file: &#39;${f}&#39;&quot;)<br>&nbsp; ENDIF(EXISTS &quot;${f}/&quot;)
<br>ENDFOREACH(f)<br><br>It exploits the fact that a directory will still pass the existence test if you append a &quot;/&quot; to its filename, whereas a file will not...<br><br>I won&#39;t guarantee that this will always work with all cmakes on all platforms, but you may find that it is a useful trick...
<br><br>:-),<br>David<br><br><div><span class="gmail_quote">On 11/22/06, <b class="gmail_sendername">Timo Rumland</b> &lt;<a href="mailto:cr@olympclan.de">cr@olympclan.de</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br><br>is it in any way possible to retrieve the list of directories within a<br>given directory and store it into a variable?<br><br>I&#39;m looking for something like FILE(GLOB ... ) or<br>FILE(GLOB_RECURSE...) that collects directory names instead of files.
<br><br><br>Thanks in advance<br><br><br>Timo<br><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">
http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br>