[CMake] FindMKL.cmake

David Cole david.cole at kitware.com
Wed Feb 9 10:49:43 EST 2011


Ah.... I know what it is. If you use "GLOB_RECURSE" you only get files
because the directories are recursed into.

You have to use GLOB alone and do the recursion manually if you want to
descend into found directories... Painful. But still possible.


On Wed, Feb 9, 2011 at 10:48 AM, David Cole <david.cole at kitware.com> wrote:

> What does this return if you save it as "glob.cmake" and then run "cmake -P
> glob.cmake" ??
>
> file(GLOB results "/*")
>
> set(dirs "")
> foreach(f ${results})
>
>   if(IS_DIRECTORY "${f}")
>     set(dirs ${dirs} ${f})
>     message("directory: '${f}'")
>   else()
>     message("file: '${f}'")
>   endif()
> endforeach()
>
> message("dirs='${dirs}'")
>
>
> I get this:
>
> C:\Users\davidcole\Dashboards\My Tests>cmake -P glob.cmake
> directory: '/$RECYCLE.BIN'
> file: '/.rnd'
> directory: '/Documents and Settings'
> directory: '/found.000'
> file: '/hiberfil.sys'
> directory: '/Intel'
> directory: '/K'
> file: '/mfg.sdr'
> directory: '/MinGW'
> directory: '/MSOCache'
> file: '/pagefile.sys'
> directory: '/Program Files'
> directory: '/Program Files (x86)'
> directory: '/ProgramData'
> directory: '/Public'
> directory: '/Python26'
> directory: '/Qt'
> directory: '/Share'
> directory: '/System Recovery'
> directory: '/System Volume Information'
> directory: '/Users'
> directory: '/Windows'
> directory: '/xampp'
> dirs='/$RECYCLE.BIN;/Documents and
> Settings;/found.000;/Intel;/K;/MinGW;/MSOCache;/Program Files;/Program Files
> (x86);/ProgramData;/Public;/Python26;/Qt;/Share;/System Recovery;/System
> Volume Information;/Users;/Windows;/xampp'
>
>
>
>
>
> On Wed, Feb 9, 2011 at 10:41 AM, Robert Bielik <robert.bielik at xponaut.se>wrote:
>
>> David Cole skrev 2011-02-09 16:32:
>>
>>  You can iterate the returned list something like this to accumulate just
>>> directory names:
>>>
>>> set(dirs "")
>>> foreach(f ${glob_results})
>>>   if(IS_DIRECTORY "${f}")
>>>     set(dirs ${dirs} ${f})
>>>   endif()
>>> endforeach()
>>>
>>
>> Hmm... doesn't work. find(...) doesn't return directories, only files...
>> :(
>>
>> /Rob
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110209/90dbb3f4/attachment-0001.htm>


More information about the CMake mailing list