Function vs. Macro in CMake

前端 未结 5 1881
执念已碎
执念已碎 2020-12-12 14:45

The official document of CMake 2.8.12 says about macro

When it is invoked, the commands recorded in the macro are first modified by rep

5条回答
  •  时光说笑
    2020-12-12 15:11

    In other words, function pushes and pops new variable scope (variables created and changed exist only in the function), macro does not. However, you can override the function default behaviour with the PARENT_SCOPE parameter of the set command.

提交回复
热议问题