QMake:使用字符串作为变量
QMake: Use string as variable
我有一个字符串,我想将它用作另一个变量名的一部分
QT_MODULE_NAME = xml
# I would like to use something like this:
LIB_PATH = $${QT.$${QT_MODULE_NAME}.libs}
但是好像不行。我得到 Missing } terminator [found $]
试试这个:
QT_MODULE_NAME = xml
LIB_PATH = $$eval("QT.$${QT_MODULE_NAME}.libs")
message($$LIB_PATH)
输出:
Project MESSAGE: /home/pedro/Qt/5.12.7/gcc_64/lib
我有一个字符串,我想将它用作另一个变量名的一部分
QT_MODULE_NAME = xml
# I would like to use something like this:
LIB_PATH = $${QT.$${QT_MODULE_NAME}.libs}
但是好像不行。我得到 Missing } terminator [found $]
试试这个:
QT_MODULE_NAME = xml
LIB_PATH = $$eval("QT.$${QT_MODULE_NAME}.libs")
message($$LIB_PATH)
输出:
Project MESSAGE: /home/pedro/Qt/5.12.7/gcc_64/lib