我有一个静态库,用于构建和创建.lib文件 . 我想在构建之后将我的.lib文件复制到自定义lib文件夹,项目增长时将存储我的所有库文件 .

在qt文档和我在这里找到的另一个旧帖子中,以下应该可以解决问题:

target.path = /lib
INSTALLS += target

但是我的库文件最终不会出现在任何lib文件夹中 .

qmake documentation older qmake stackoverflow post used as reference

我在Windows 10上使用QtCreator,我正在使用MSVC14构建 . 目前我正在进行调试构建,并试图让这个工作我禁用阴影建设 . 文件夹结构如下 .

MyProject
-debug
-release
-include
-src
-lib //location will be elsewhere once i get it working

MyLib.pro

QT += quick qml gui

TARGET = MyProject
TEMPLATE = lib
CONFIG += staticlib

DEFINES += QT_DEPRECATED_WARNINGS\
debug:DEFINES +=   A_CUSTOM_PREPROCESSOR_ARGUMENT
HEADERS += \
    include/some.h\
    # and the rest of header files.

SOURCES += \
    src/some.cpp\
    # and the rest of the cpp files.

INCLUDEPATH += ./include

target.path = $$PWD/lib
INSTALLS += target

unix {
    target.path = /usr/lib
    INSTALLS += target
}

至于target.path我尝试了几个不同的版本 .

  • ./lib

  • $$ PWD / lib

  • / lib

  • debug / lib

  • / $$ / lib

我对错误的看法