[CMake] custom targets can't be used in different subdirectories?

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Wed Nov 28 11:35:06 EST 2007


Hi,

I'm currently trying to build a project organized in subdirectories.  
In all the subdirectories, several files are generated at build time  
(with an ADD_CUSTOM_COMMAND).
In all the directories, a custom target depending on all the files  
generated in the subdirectory is created with ADD_CUSTOM_TARGET, so  
it should be easy to declare a dependancy on all those files in  
another subdirectory.

During the build, things are all right until "make" try to build a  
file which depends on a custom target from another subdirectory. Here  
is an example:

[glehmann at marvin build]$ LC_ALL=C make BaseSwig
[  0%] Built target VXLNumericsIdx
make[3]: *** No rule to make target `VXLNumericsIdx', needed by  
`ClassIndex/wrap_ITKCommonBase.i'.  Stop.
make[2]: *** [Modules/Base/CMakeFiles/BaseSwig.dir/all] Error 2
make[1]: *** [Modules/Base/CMakeFiles/BaseSwig.dir/rule] Error 2
make: *** [BaseSwig] Error 2

VXLNumericsIdx is defined in one subdir, and BaseSwig in another on.  
"make" reports that the custom target "VXLNumericsIdx" is built  
(that's true), but the line after, it say it can't find that target.
It seems definitively strange to me!

I'm using cmake cvs 2007-10-24, and have seen the same behavior with  
cmake 2.4.5

Any idea about what can be wrong?

Thanks,

Gaëtan

-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr




-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: =?ISO-8859-1?Q?Ceci_est_une_signature_=E9lectronique_PGP?=
Url : http://public.kitware.com/pipermail/cmake/attachments/20071128/604bce4d/PGP.pgp


More information about the CMake mailing list