3 ms·
Most of the time in CMake, you want expansion, so: my_function("${MY_VAR}") Avoid the quotes if your variable contains spaces or other separators, and it'
by mikepurvis 9y ago
Most of the time in CMake, you want expansion, so:
my_function("${MY_VAR}")
Avoid the quotes if your variable contains spaces or other separators, and it's your intention for the separate pieces to go into the function or macro independently.
The other case is builtin macros that expect to be passed the name of a variable that they themselves are manipulating. For example the list and string operations. See: https://cmake.org/cmake/help/v3.0/command/list.html https://cmake.org/cmake/help/v3.0/command/list.html