[CMake] How to find list of directories

Renato Utsch renatoutsch at gmail.com
Thu Dec 15 08:34:25 EST 2011


Hello,

I am writing a plugin compiler that will do linke this:

-- main
---- plugin
----| CMakeLists.txt (in the plugin folder)
------ example (example plugin)
------| CMakeLists.txt (in the example folder)

The CMakeLists.txt file inside the plugin folder will do a foreach() to use
add_subdirectory() for each folder inside the plugin directory:

foreach( FOREACH_FOLDER ${FOLDERS_INSIDE_PLUGIN} )
    add_subdirectory( ${FOREACH_FOLDER} )
endforeach()

Then, the CMakeLists.txt of each folder will do the compilation of the
plugin....


How can I set the FOLDERS_INSIDE_PLUGIN variable to a list with all the
folder names in the plugin directory? My program will be compiled only in
UNIX (and cygwin), so if there is an UNIX command that does this, it can
work as well (couldn't remember any)...


Renato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111215/ff129163/attachment.htm>


More information about the CMake mailing list