Hi,

is it possible to list the subdirectories from a given folder?
I use this function but it returns me the file in the current path.

macro(list_subdirectories retval curdir return_relative)

   file(GLOB sub-dir RELATIVE ${curdir} *)
   set(list_of_dirs "")
   foreach(dir ${sub-dir})
     if(IS_DIRECTORY ${curdir}/${dir})
       if (${return_relative})
         set(list_of_dirs ${list_of_dirs} ${dir})
       else()
         set(list_of_dirs ${list_of_dirs} ${curdir}/${dir})
       endif()
     endif()
   endforeach()
   set(${retval} ${list_of_dirs})
endmacro()

I can notuse the FILE() with a different path than the current path.

Thank you for your help

--
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to