[CMake] bug ? changed behaviour of ADD_CUSTOM_COMMAND
Anton Deguet
anton at cs.jhu.edu
Fri Sep 16 09:45:53 EDT 2005
It might be worth putting this in the SWIG section of the WiKi pages.
This is pretty useful to start a Python (or whatever script) which
relies on a SWIG wrapped library.
Anton
On Fri, 2005-09-16 at 09:22 -0400, Brad King wrote:
> Alexander Neundorf wrote:
> > Hi,
> >
> > since Makefile generator 2 the following cmake code doesn't work anymore:
> >
> > ----------8<-----8<--------8<-------------
> >
> > ADD_CUSTOM_TARGET( world echo "world" DEPENDS hello)
> >
> > ADD_CUSTOM_TARGET( hello echo "hello" )
> >
> > ----------8<-----8<--------8<-------------
> >
> > Currently "make world" leads to
> > make[3]: *** No rule to make target `hello', needed by `world'. Stop.
> >
> > although the target "hello" is defined with the next command.
> > With cmake 2.0 this did work and "make world" executed first "hello" and
> > then "world".
> > Is this change intentional ?
>
> The original behavior was not intentional. The DEPENDS option of
> ADD_CUSTOM_TARGET is meant for dependencies on the outputs of
> ADD_CUSTOM_COMMAND. It was just coincidence that the generated makefile
> had the right dependencies, and I don't think it worked in other generators.
>
> The way to add dependencies between top-level targets is with the
> ADD_DEPENDENCIES command:
>
> ADD_CUSTOM_TARGET( world echo "world" )
> ADD_CUSTOM_TARGET( hello echo "hello" )
> ADD_DEPENDENCIES( world hello )
>
> -Brad
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
--
Anton Deguet <anton at cs.jhu.edu>
ERC CISST Johns Hopkins University
More information about the CMake
mailing list