Querying and Transforming
Many generator expressions are available, but to avoid getting lost in the weeds, let’s focus on the most common ones. We’ll start with some basic transformations of the available data.
Dealing with strings, lists and paths
Generator expressions provide only the bare minimum of operations to transform and query data structures. Working with strings in the generator stage is possible with the following expressions:
$<LOWER_CASE:string>
,$<UPPER_CASE:string>
– convertsstring
to the required case.
List operations were fairly limited until recently. Since CMake 3.15, the following operations were available:
$<IN_LIST:string,list>
– returns true iflist
contains astring
value$<JOIN:list,d>
– joins a semicolon-separatedlist
using ad
delimiter.$<REMOVE_DUPLICATES:list>
– deduplicateslist
(without sorting).$<FILTER:list,INCLUDE|EXCLUDE,regex>
– includes/excludes items from...