我正在寻找一种方法将字符串解释为cmake中的变量名.
鉴于:
set(MY_SECRET_VAR "foo")
# later only the name of the variable is known.
set(THE_NAME "MY_SECRET_VAR")
# Now i'm looking for a way to get the value "foo" from the name
# something like:
set(THE_VALUE "${THE_NAME}")
# THE_VALUE should be "foo"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4031 次 |
| 最近记录: |