gpt4 book ai didi

qmake 获取目标输出文件路径

转载 作者:行者123 更新时间:2023-12-02 01:41:27 34 4
gpt4 key购买 nike

我有一个看起来像这样的 qmake 项目:

TEMPLATE = lib
CONFIG += dll
TARGET = mydll

SOURCES += ...
HEADERS += ....

现在我想添加一个 INSTALLS部分,所以我有:
target.path = /path/to/somedir/
target.files =./$$TARGET

INSTALLS+= target

不幸的是,这行不通,因为 $$TARGET包含目标名称,而不是输出文件名。有没有 可移植 获取输出文件名的方法? (请不要依赖于平台的字符串连接,如 lib + $$TARGET + .so )

最佳答案

您不必指定 target.files , target是一个特例,它在 qmake 中预定义.

http://qt-project.org/doc/qt-4.8/qmake-environment-reference.html#installs

If you append a built-in install set to the INSTALLS variable and do not specify files or extra members, qmake will decide what needs to be copied for you. Currently, the only supported built-in install set is target:

target.path = /usr/local/myprogram
INSTALLS += target

In the above lines, qmake knows what needs to be copied, and will handle the installation process automatically.

关于qmake 获取目标输出文件路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28342708/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com