Assume that I have the expression “/home/user/foo.bar” as the result of a generator-expression and I would like to remove the suffix “.bar”. In practice, the first expression is the full path to an object file and the second is the suffix, that I need to remove in order to obtain the expression “/home/user/foo” which I can then write to file using
file(GENERATE OUTPUT filename CONTENT “$<…>”)
Is it possible to remove substrings within generator expressions?
Thanks! In my understanding, generator expressions are evaluated AFTER the CMakeLists.txt file(s) have been processed. How can I “put” the result of a generator expression into a variable that I can then further process using STRING? Thanks in advance.
Thanks but it’s not that easy I guess. I need the base name of a particular object file of a target. It’s the attempt to solve my problem with precompiled headers described in a previous post.
I suggested other solutions over there, but I think that more path manipulation/extraction genexes are likely useful anyways. A feature request for them would be useful.