[CMake] add_custom_target problem
Hariharan Iyer
hariharan022 at gmail.com
Wed Jun 9 12:12:07 EDT 2010
On Wednesday 09 June 2010 09:35 PM, Michael Wild wrote:
> On 9. Jun, 2010, at 17:47 , Hariharan Iyer wrote:
>
>> 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
>>
> Read the docs more carefully? ;-) You need to add ALL as an option to the add_custom_target command.
>
> Michael
>
I knew I was making some elementary mistake. I had read the docs but I
misunderstood the meaning of "all". Thanks a lot !
~Hari
More information about the CMake
mailing list