[CMake] C/C++ dependency scanner

Bill Hoffman bill.hoffman at kitware.com
Fri Mar 19 09:36:56 EDT 2010


Steven Wilson wrote:
> That's an interesting idea.   Would this step attach the dependencies to 
> the .c file or the .bc file?
> 
> 
It would attach them to the .c file.


> 
> On Thu, Mar 18, 2010 at 7:49 PM, Bill Hoffman <bill.hoffman at kitware.com 
> <mailto:bill.hoffman at kitware.com>> wrote:
> 
>     I have a hack of an idea that might work....
> 
>     If you could changed your bc -> c generator to put in the #include
>     lines , but with if blockers around it:
> 
>     #if FOOL_CMAKE_DEPEND_SCANNER
>     #include "foo.h"
>     #include "bar.h"
>     #endif
> 
>     Since CMake ignores #if directives will depend on foo and bar, but
>     the c compiler will not expand them.
> 
>     -Bill
> 


More information about the CMake mailing list