[Cmake] Make clean

Brad King brad . king at kitware . com
Wed, 26 Nov 2003 10:50:07 -0500 (EST)


On Wed, 26 Nov 2003, Gerhard Esterhuizen wrote:

> I have a directory containing a Doxygen (automatic source code
> documentation extraction utility) configuration file, "api-docs.doxy".
> My "CMakeLists.txt" contains the following line
>
> ADD_CUSTOM_TARGET(api-docs ALL doxygen api-docs.doxy DEPENDS api-docs.doxy)
>
> which runs Doxygen as part of the default Makefile target. This creates
> a DIRECTORY called "api-docs", which is what I want. However, when I do
> a "make clean", the directory isn't removed. This is due to the Makefile
> using "cmake" (instead of "rm") to delete the files during the execution
> of the "clean" target.  Is there anyway I can reconfigure the Makefile
> to use "rm" instead or of instructing the "cmake" remove command to
> delete directories as well as files ?

There is no portable command line interface for removing files or
directories that works on all unix/windows/mac systems.  The "cmake -E"
commands are designed to provide a compatibility layer.

> Or is there a completely better way of achieving my goal ?

I've just added a FAQ entry for this issue:

http://www . cmake . org/cgi-bin/cmakefaq . cgi?req=all#5 . 8

-Brad