[Insight-users] slightly off-topic: question on CMakeLists

Martin Urschler urschler at icg.tu-graz.ac.at
Sat Aug 26 03:02:31 EDT 2006


hi all,

I have a question concerning cmake. Perhaps someone reading the list 
knows this. I have a project with some subdirectories that correspond to 
sub-modules. One of these sub-modules should be extensible by plugins. 
Now, since it should not be necessary a priori to know which plugins 
should be compiled (since by default there are no plugins in the plugins 
directory), i need a way to check for directories on the file-system 
using CMake.

My project (and directory) structure looks like this

project - submodule1
         - submodule2
         - ...
         - submodule n - plugin 1
                       - plugin 2
                       - ...
                       - plugin n

By definition, every sub-directory in 'submodule n' should be a plugin 
(so every directory 'plugin i' contains a CMakeLists.txt file, that gets 
included by ADD_SUBDIRECTORY in the CMakeLists.txt of 'submodule n'), 
therefore i need a way to get the directory names (plugin 1 --- plugin 
n) and for each of these entries i would use an ADD_SUBDIRECTORY 
commmand. I have no idea how to get the directory names with cmake.

i hope this is clear, and someone can help me!

thanks,
Martin



More information about the Insight-users mailing list