[CMake] Problems globbing directory by FILE(GLOB_RECURSE)

David Cole david.cole at kitware.com
Wed Feb 4 06:51:43 EST 2009


Did you try:
FILE (GLOB_RECURSE item "/path/to/some/area/*")

(Note the "/*" on the end of the globbing expression...)


On Wed, Feb 4, 2009 at 6:28 AM, Ashutosh Juneja
<ashutosh.juneja at gmail.com>wrote:

> Hi,
>
> I want to glob directories from a specified location, but unable to do so.
> My purpose is to run cmake and generate CTestTestfile.cmake in binary tree
> having multiple ADD_TEST commands.
>
> i.e. I want to extract directories ABC and DEF from an area listed below:
> /path/to/some/area/ABC
> /path/to/some/area/DEF
> /path/to/some/area/XYZ
> /path/to/some/area/PQR.txt
>
> I am using following code:
> ====Source tree: CMakelists.txt ====
> FILE (GLOB_RECURSE item "/path/to/some/area")
>
> FOREACH(suite ${item})
>      MESSAGE ("Now Globbing..... ${item}")
>      ADD_TEST(${suite} EXEC /path/to/wrapper/script)
> ENDFOREACH(${item})
> =============================
>
> Can you provide any pointers to this?
> Is FILE(GLOB_RECURSE) the only method for globbing directory?
>
> Regards,
> Ashutosh
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090204/9350b56f/attachment-0001.htm>


More information about the CMake mailing list