[CMake] FindMKL.cmake
Robert Bielik
robert.bielik at xponaut.se
Wed Feb 9 11:50:29 EST 2011
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
More information about the CMake
mailing list