Custom target exporting
Discussion for !6332 (closed).
The idea is to provide a simple method to generate target export in a text format. Unlike #20106 I want to implement it in CMake script and without additional tools. It can be done this way even now, but the implementation is ugly and long (example). To make is simple and convenient I propose to extend CMake with the following changes (implemented in !6332 (closed)).
- Extend generator extension grammar with escaping symbols to allow change expansion order and thus implement curring. With that I propose to implement
$<TRANSFORM:list,action,[args...]>
expression to map list values. Would looks as follows:
$<TRANSFOMR:list,($<GET_TARGET_PROPERTY:_,TYPE>)>
_
is a placeholder for list entry, (
and )
are escapes for pass $<GET_TARGET_PROPERTY:_,TYPE>
to TRANSFORM
without expanding it first.
- Allow
file(GENERATE ...)
to selectINSTALL_INTERFACE
.
These two features would make exporting targets so much simpler.
@brad.king, in !6332 (closed) you wrote that this exposes too many details to expressions, did you mean the build/install inteface as the new exposed detail?