[CMake] add_custom_target dependencies error

Pau Garcia i Quiles pgquiles at elpauer.org
Tue Jun 26 06:03:50 EDT 2007


Quoting Mehdi Rabah <mehdi.rabah at gmail.com>:

> Hello,
>
> I'm seeking for help for a weird error that is happening to me.
> I have a cmake project, with a lot of target, two of them are named
> subproject1_deb, and subproject2_deb
>
> $ make help:
> The following are some of the valid targets for this Makefile:
> ... all (the default if no target is provided)
> ... clean
> ... depend
> ... deb
> ... edit_cache
> ... install
> ... install/local
> ... list_install_components
> ... package
> ... package_source
> ... rebuild_cache
> ... deb_destdir_install
> ... hugr_deb
> ... iplimage_deb
>
> The deb target is declared as the following:
>
> ADD_CUSTOM_TARGET ( deb
>                    DEPENDS subproject1_deb, subproject2_deb )
>
> but when I try to make the deb target, here the error I get:
>
> Built target subproject1_deb
> make[3]: *** No rule to build target « ../subproject2_deb, », needed for «
> CMakeFiles/deb ». Stop. (translated)
>
> But, when I type make subproject2_deb, everything is ok.
>
> Do you have a clue of what am I doing wrong ?
> I am using a script to generate subprojects_deb (debian packages).
> http://vtk.org/Wiki/CMakeUserUseDebian

You have a spurious comma. It should be:
ADD_CUSTOM_TARGET ( deb DEPENDS subproject1_deb subproject2_deb )

-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to the amount of work, I usually need 10 days to answer)


More information about the CMake mailing list