Much like: CMake add prefix to each element of a list
I have a list of things (directories, but not always directories) – I need to pass to a custom tool. Generically, for each item in the list I need to insert either “–include” or “–exclude” or “–sometext” in front of each item.
Example:
set( ELIST thisdir thatdir otherdir )
set( ILIST adir bdir cdir )
These need to be passed into a function I create
in that function, I want to expand the passed list into: ‘–exclude thisdir –exclude thatdir –exclude otherdir’ or “-include adir –include bdir –include cdir”
I then pass these on the command line to my custom tool I need to run.
Is there a GENERIC way to do this? Or do I need to do this manually for each thing?
ie: GNU Make has addprefix – I am looking for the same thing