[CMake] Cmake unable to detect dependencies

Michael Wild themiwi at gmail.com
Mon Dec 5 02:35:43 EST 2011


On 12/04/2011 03:37 PM, Surya Kiran Gullapalli wrote:
> Hello all,
> 
> I'm building several executables which are located in a single
> directory. Each executable has different include path. I'm calling
> add_executable in a loop and If I call Include_Directories in the loop,
> the last built executable will have a long include path.
> 
> To avoid that, I'm setting COMPILE_FLAGS property on each of the target
> in the loop. But I'm facing a problem with cmake due to this. CMake is
> not identifying the dependencies in the include path. 
> 
> In short, If Include_Directories is replaced by Set_Property, cmake is
> not generating proper dependency information. Is this expected or is
> this a defect ?
> 
> Thanks,
> Surya
> 

Include-directories are a property of the current source directory, not
of the individual targets. The latter is a feature that is currently in
development, though. This is also why include-directories are not
propagated through dependencies. Such a propagation would also be
difficult to implement, as it would need to distinguish between "public"
and "private" include directories and it would be very difficult to
determine the correct ordering of these automatic include directories.

Michael


More information about the CMake mailing list