Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从cmake宏返回值_Cmake - Fatal编程技术网

从cmake宏返回值

从cmake宏返回值,cmake,Cmake,我想创建一个cmake宏,用一些值填充给定变量,例如: macro ( fillList list ) set( list a b c ) endmacro() fillList( list ) 这在cmake看来是不可能的。在cmake中实现这一点的任何建议?传递变量名称并使用: macro(fillList list) set(${list} a b c) endmacro()

我想创建一个cmake宏,用一些值填充给定变量,例如:

macro ( fillList list )    
    set( list a b c )
endmacro()

fillList( list )

这在cmake看来是不可能的。在cmake中实现这一点的任何建议?

传递变量名称并使用:

macro(fillList list)
  set(${list} a b c)
endmacro()