On Wed, May 27, 2009 at 11:01:51PM +0000, [email protected] wrote:
> foo.h is generated from foo.x. And foo.h is included by bar.h. And then  
> bar.h is included by a lot of c files. So actually every c files including  
> bar.h depends on foo.h.
> But the file number is so big that I don't want to add dependency for each  
> one.

CMake knows how to resolve these header dependencies. So any file that
#includes (or #includes something that #includes) foo.h will be
recompiled if foo.h changes. You don't need to do anything else for this
part.

> How can I specify foo.x is generated before all the c files being compiled? 
> It seems add_custom_target works but it will regenerate foo.h every time  
> even the foo.x is not modified.

If your custom_target() has correct OUTPUT and DEPENDS parameters, this
should not happen. Are you specifying ALL in your add_custom_target()?

tyler
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to