Indirect Call - Call function by name
It would be useful to be able to call a function by name:
"${fnname}"(args)
This is currently possible by writing a file and include
ing it, with syntax as such:
indirect_call("${fnname}" args)
However, it would be faster/nicer if this was possible in the language itself.
My use case is for callbacks / function objects:
function(call_me)
# Called by my_fancy_cmake_function when some condition holds true
endfunction()
my_fancy_cmake_function(
SOME_ARGS 1 2 3
ON_SOME_CONDITION call_me
)