[Cmake] Make clean

Brad King brad . king at kitware . com
Wed, 26 Nov 2003 13:01:55 -0500 (EST)


> > http://www . cmake . org/cgi-bin/cmakefaq . cgi?req=all#5 . 8
>
> I read that and it makes alot of sense. Unfortunately I am now
> struggling with the out-of-source build. I left my ADD_CUSTOM_TARGET
> line unchanged as
>
> ADD_CUSTOM_TARGET(api-docs ALL doxygen api-docs.doxy DEPENDS api-docs.doxy)
>
> and do "cmake _sourcedir_" from the build directory, where "_sourcedir_"
> is the relative path to the source directory from the build directory.
> When I do "make" it complains with a "No rule to make target
> 'api-docs.doxy'" (which is the dependancy). What is the correct way of
> specifying the dependancy path so that it is independant of the build
> directory or is this impossible ?

You need to use a combination of ADD_CUSTOM_TARGET and ADD_CUSTOM_COMMAND.
Use

  cmake --help ADD_CUSTOM_TARGET

and

  cmake --help ADD_CUSTOM_COMMAND

to read about the commands.  Basically you should use ADD_CUSTOM_TARGET to
add a driver target with a DEPENDS that points at the output of a rule
specified by ADD_CUSTOM_COMMAND that actually runs doxygen.

-Brad