GenEx: Map a genex over a list
I need to get all the directories of the linked dependencies of target's executable, so that I can pass those directories to a second target's custom command (which invokes the executable to generate source files for the second target).
I can't use file(GET_RUNTIME_DEPENDENCIES ...)
because it won't work during configuration time, and I need to manipulate the list (with cmake_path
) and then remove duplicates before passing it to the custom command.
Neither can I use $<TARGET_RUNTIME_DLLS:exe_target>
+ $<PATH:GET_PARENT_PATH,path>
+ $<REMOVE_DUPLICATES:list>
, as there is no way to map PATH:GET_PARENT_PATH
over the list.
The absence of mapping in the generator language is crippling. You need some kind of syntax like this: $<REMOVE_DUPLICATES:$<MAP:$<TARGET_RUNTIME_DLLS:exe_target>,$<PATH:GET_PARENT_PATH,$<X>>,X>>