[CMake] How to nuke a directory (for 'make clean')?

Alexander Neundorf a.neundorf-work at gmx.net
Sat Mar 10 04:34:29 EST 2007


-------- Original-Nachricht --------
Datum: Fri, 09 Mar 2007 18:51:28 -0600
Von: Matthew Woehlke <mw_triad at users.sourceforge.net>
An: cmake at cmake.org
CC: 
Betreff: [CMake] How to nuke a directory (for \'make clean\')?

> Ok... so I make documentation for my project with:
> 
> ADD_CUSTOM_TARGET(doc doxygen ${CMAKE_BINARY_DIR}/Doxyfile)
> 
> It works great, except that 'make clean' doesn't touch it. Since there 
> is no practical way to know what files this makes, but it IS known that 
> all generated files will be in a particular directory (in my case, my 
> Doxyfile.cmake puts them in ${CMAKE_BINARY_DIR}/doc), how can I cause 
> 'make clean' to effectively/portably 'rm -rf ${CMAKE_BINARY_DIR}/doc'?

I didn't test, but you could try SET_DIRECTORY_PROPERTIES( ADDITIONAL_MAKE_CLEAN_FILES ) , but I'm not sure it also works with directories. You could also create a using ADD_CUSTOM_TARGET(doxyclean ... ) which calls cmake -E ... to remove the directory and make this target depend on the "clean" target.

Alex


-- 
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: www.gmx.net/de/go/mailfooter/topmail-out


More information about the CMake mailing list