David Cole skrev 2011-02-09 16:49:
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.

Something like:

macro(find_dir_deep RESULT_PATHS BASE_PATH)
  file(GLOB results "${BASE_PATH}/*")
  foreach(f ${results})
    if(IS_DIRECTORY "${f}")
      set(${RESULT_PATHS} ${${RESULT_PATHS}} ${f})
      find_dir_deep(${RESULT_PATHS} ${f})
    endif()
  endforeach()
endmacro(find_dir_deep RESULT_PATHS BASE_PATH)

set(dirs "")
find_dir_deep(dirs "C:/Program Files/Common Files")
message("dirs='${dirs}'")

/Rob
_______________________________________________
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