[CMake] add_custom_target problem

Hariharan Iyer hariharan022 at gmail.com
Wed Jun 9 11:47:32 EDT 2010


  This may not be only because of using add_custom_target, but I have 
the following problem. I have a custom target that depends on a 
generated file, as:
add_custom_target(foo DEPENDS bar)

where "bar" is a generated file, generated using add_custom_command.

If I build the "foo" target by itself, it builds perfectly. However, if 
I build the default "all" target, "foo" does not get built. My top-level 
listfile has add_subdirectories(foo), and the custom target line above 
is present in the listfile for the "foo" directory.

What am I missing or doing wrong?

Regards,
Hari


More information about the CMake mailing list