############################### cmakepp_lang/utilities/call_fxn ############################### .. module:: cmakepp_lang/utilities/call_fxn .. function:: _cpp_call_fxn_guts(fxn2call result) Performs most of the work for dynamically calling a function. ``cpp_call_fxn`` is a macro to avoid needing to forward returns. In order to actually call the function we need to write the call to disk. This involves setting a few variables, so in order to avoid contaminating the caller's namespace we wrap this part of ``cpp_call_fxn`` in this function, ``_cpp_call_fxn_guts``. ``_cpp_call_fxn_guts`` is not intended to be called from outside of ``cpp_call_fxn``. :param fxn2call: The name of the function we are calling. :type fxn2call: desc :param \*args: The arguments to forward to the function. .. function:: cpp_call_fxn(fxn2call) .. note:: This is a macro, and so does not introduce a new scope. Calls a function who's name is provided at runtime. CMake does not allow you to dynamically determine the name of a function. For example one can NOT do ``${name_of_fxn}()`` or any other variation which retrieves part of the function's name from a variable. The ``cpp_call`` macro allows us to circumvent this limitation at the cost of some I/O. :param fxn2call: The name of the function to call. :type fxn2call: desc :param \*args: The arguments to forward to the function. .. note:: ``cpp_call_fxn`` is a macro to avoid creating a new scope. If a new scope was created it would be necessary to forward returns, which would significantly complicate the implementation.