[CMake] Recursively add directories to INCLUDE_DIRECTORIES

2012-06-11 Thread GOO Creations
Hi all, I want to recursively scan all sub-directories (and their sub-directories, etc ...) and determine if the directory contains a header (.h) file. I then want to add this directory to INCLUDE_DIRECTORIES. The best thing (according to my CMake knowledge) is to write a macro for this and

Re: [CMake] Recursively add directories to INCLUDE_DIRECTORIES

2012-06-11 Thread Leif Walsh
Use the GLOB_RECURSE mode of file() (cmake --help-command file) and get_filename_component. Sent from my iPhone On Jun 11, 2012, at 11:09, GOO Creations goocreati...@gmail.com wrote: Hi all, I want to recursively scan all sub-directories (and their sub-directories, etc ...) and

Re: [CMake] Recursively add directories to INCLUDE_DIRECTORIES

2012-06-11 Thread GOO Creations
Thanks. I was sitting for hours trying to write this huge macro and now the solution isso easy. For future readers, here is my macro: /MACRO(HEADER_DIRECTORIES return_list)/ /FILE(GLOB_RECURSE new_list *.h)/ /SET(dir_list )/ /FOREACH(file_path ${new_list})/ /