[CMake] CMake 3.9 change to dependencies of object compilation

Puetz Kevin A PuetzKevinA at JohnDeere.com
Fri Aug 4 14:59:46 EDT 2017


> -----Original Message-----
> From: Robert Maynard [mailto:robert.maynard at kitware.com]
> Sent: Friday, August 04, 2017 1:03 PM
> To: Ben Boeckel <ben.boeckel at kitware.com>
> Cc: Puetz Kevin A <PuetzKevinA at JohnDeere.com>; cmake at cmake.org
> Subject: Re: CMake 3.9 change to dependencies of object compilation
> 
> You can find the location for object files by using
> $<TARGET_OBJECTS:${name}>. This can be used as the DEPENDS of a custom
> command. I would not try using OBJECT_OUTPUTS as IIRC that is only used by
> the makefile generator.

Isn't TARGET_OBJECTS  only for OBJECT libraries? I don't think it would give me a way to get the paths for the .o file that's going to result from a particular source file (in order to locate other files the compiler is going to generate alongside a .o file).

But and in any case, this was a little bit of an aside, just because Ben asked what #import generated. It would feel *correct* to inform that the .tlh/.tli files were OBJECT_OUTPUTS, but nothing in the processing really *needs* to know. The problem I'm having with 3.9 is the input dependency on registry keys (previously modeled as a dependency on the target whose POST_BUILD would create them), not on the outputs.
 


More information about the CMake mailing list