SPAM-MED: Re: [CMake] disabling features such as C++

William A. Hoffman billlist at nycap.rr.com
Tue Feb 7 08:07:23 EST 2006


At 01:16 AM 2/7/2006, Reggie Burnett wrote:
>Bill
>
>Thanks for the info.  I got it going.  Now I have another issue.
>
>I have a project that has about 10 top level targets.  Each of these are in
>their own folder.  In one of them I have a custom command that generates a
>header file.  This header file is used in several other top level targets.
>I'm having a difficult time getting the header file to be generated.  When I
>attempt to build the target that comes from the cmakelists.txt that includes
>the ADD_CUSTOM_COMMAND, it worked.  However, when I tried to build one of
>the other targets that also depends on the generated header, it's not
>generated.
>
>Can you help?

You have to tell CMake that the targets need each other.  You can do this in
two ways. 

1. if the targets are libraries, you can use target_link_library.
2. if they are not libraries, or you do not want them linked to each other,
then you can use ADD_DEPENDENCIES. 

-Bill



More information about the CMake mailing list