[CMake] communicat variables from sub directories

Axel Roebel Axel.Roebel at ircam.fr
Wed Apr 5 11:09:33 EDT 2006


Hello,

I am trying to collect source file lists from sub directories
into the main cmake cache.

The idea is that the main directory gets a collection of all source files and 
header files such that it may run a doxygen whenever one of these files has 
changed.

Imagine

SET(DOCFILES "" CACHE INTERNAL "list of all files containing doc")
ADD_SUBDIRECTORY(src )
ADD_SUBDIRECTORY(include)

and in each subdir I tried various versions like

SET(DOCFILES ${DOCFILES}${LISTOFSRCS} )

or what I considered more likely to be correct

SET(DOCFILES ${DOCFILES}${LISTOFSRCS} CACHE INTERNAL "list of all files 
containing doc")


This gives me a correct list of files in the subdirectory
but the variable in the main directory is not changed.

For now I found that  I need to create a new cache variable in the
sub directories to be able to read the content of that variable in the main 
directory so that's what I do now. 

Does anybody know how to make that work with a more elegant
solution ?

Thanks for any comments.


-- 
Axel Roebel    
IRCAM Analysis/Synthesis Team
Email: Axel.Roebel at ircam.fr | Phone: ++33-1-4478 4845 | Fax: ++33-1-4478 1540



More information about the CMake mailing list