I would like to find a path of an .obj file in Cmake using $<TARGET_OBJECTS>
(as described in How to get path to object files with CMake for both multiconfiguration generator and makefile based ones?).
I have found How can I check in CMake whether a list contains a specific entry? - however, it seems to me that both
if ("bar" IN_LIST _list)
...
endif()
and list (FIND _list "bar" _index)
approaches look for strict equality (in this example, one of the list entries must be equal to "bar").
What can I do, to find and return the (first) item in a CMake list which contains a substring (or matches a regex)? A priori I'd only know the filename of the .obj file, e.g. myfile.c.obj
- and I'd like to query CMake for its full path.