Is there a way to call a function in CMake using the name that is stored in a variable (for passing functions to functions, etc)?
Here is what I have tried:
cmake_minimum_required(VERSION 3.0)
function(doThing)
endfunction()
set(FuncVar doThing)
${FuncVar}()
Which fails with this error:
Parse error. Expected a command name, got unquoted argument with text "${FuncVar}".
-- Configuring incomplete, errors occurred!
I can't see why this shouldn't work, but then again I am new to CMake so what do I know.
Thank you for any help!
cmake_language(EVAL CODE <code>...)
cmake.org/cmake/help/latest/command/…