Cmake简单教程分析和总结.docxVIP

  • 4
  • 0
  • 约2.23千字
  • 约 3页
  • 2023-04-26 发布于上海
  • 举报
Cmake 简单教程 变量赋 set(VAR a b c) VAR为变量名 a b c 为变量的值用空格分隔 变量使用 ${VAR} 例如: set (Foo a b c) command (${Foo}) 相当于 command (a b c) 流程控制语句 1. if if if(var) some_command(...) endif(var) 2. 2. foreach and while set (VAR a b c) foreach (f ${VAR}) message(${f}) endforeach(f) 3. macro and function // //定义宏 macro (hello MESSAGE) message($ {MESSAGE}) endmacro (hello) //调用 hello(hello world) //定义函数 function (hello MESSAGE) message(${MESSAGE}) endfunction(hello) //function 与 macro 的区别: function create a local scope for variables. // macros user the global scope. 正则表达式 正则表达式 ^ 匹配 行或字符串的开始 $ 匹配 行或字符串的结尾 . 匹配 除了

文档评论(0)

1亿VIP精品文档

相关文档