No way to forward function arguments
There is, as far as I can tell, no way to implement generic wrapper functions, such as my_function() forwards it's arguments to function().
Prior discussion on this subject includes:
- https://crascit.com/2019/01/29/forwarding-command-arguments-in-cmake/
- #21011
- #20800 (closed)
- https://github.com/polysquare/cmake-forward-arguments/blob/master/ForwardArguments.cmake
and a few dozen stackoverflow questions about the subject.
I have a pretty basic use case in mind.
I want to have a wrapper function my_target_link_libraries() which first calls target_link_libraries() with the parameters unaltered, and then does whatever other thing it wants to.
In my case, I want to use it for tracking dependency relationships between targets, but that's rather immaterial to the current issue.
This is a fundamental ability in essentially every other programming environment out there that CMake lacks. It would be incredibly useful.
Edited by Michael Jones