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 "*")<br><br>FOREACH(f ${fl})
<br> IF(EXISTS "${f}/")<br> MESSAGE(STATUS " directory: '${f}'")<br> ELSE(EXISTS "${f}/")<br> MESSAGE(STATUS " file: '${f}'")<br> ENDIF(EXISTS "${f}/")
<br>ENDFOREACH(f)<br><br>It exploits the fact that a directory will still pass the existence test if you append a "/" to its filename, whereas a file will not...<br><br>I won'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> <<a href="mailto:cr@olympclan.de">cr@olympclan.de</a>> 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'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>