OBJECT_OUTPUTS should have a way to specify a path relative to the object output
For a flag such as GCC's -gsplit-dwarf
, it also outputs a .dwo
beside the output .o
. Adding this to OBJECT_OUTPUTS
is hard to get right.
The main problem is that the source may be attached to multiple targets and have multiple output rules, so the output paths may conflict when used in a source file shared between multiple targets. Additionally, the object path used by CMake is an "internal" detail and requires "knowing" what CMake is doing. It would be nice to have a <OBJECT_OUTPUT>
replacement string to use for this property replaced on each object compilation. This still leaves the flag above out in the cold because one extension needs stripped before adding the .dwo
extension. Maybe <OBJECT_OUTPUT_BASE>
or <OBJECT_OUTPUT_WE>
? Should these be generator expressions only usable in this context?
Cc: @brad.king