以下是qml-material.git项目的工程配置文件内容:
TEMPLATE = lib
TARGET = material
CONFIG += c++11
QT += qml quick
android {
QT += androidextras svg xml
}
HEADERS += plugin.h \
core/device.h \
core/units.h
SOURCES += plugin.cpp \
core/device.cpp \
core/units.cpp
RESOURCES += ../icons/core_icons.qrc
target.path = $$[QT_INSTALL_QML]/Material
material.files += \
components/* \
controls/* \
core/* \
popups/* \
window/*
material.path = $$[QT_INSTALL_QML]/Material
extras.files += extras/*
extras.path = $$[QT_INSTALL_QML]/Material/Extras
listitems.files += listitems/*
listitems.path = $$[QT_INSTALL_QML]/Material/ListItems
styles.files += styles/*
styles.path = $$[QT_INSTALL_QML]/QtQuick/Controls/Styles/Material
#qmldir.target = $$OUT_PWD/out/qmldir
#qmldir.commands = mkdir -p $$OUT_PWD/out;
#qmldir.commands += sed \"s/$$LITERAL_HASH plugin material/plugin material/\" $$PWD/qmldir > $$qmldir.target
#qmldir.depends = $$PWD/qmldir
qmldir.path = $$[QT_INSTALL_QML]/Material
qmldir.files = $$PWD/qmldir
qmldir.CONFIG += no_check_exist
INSTALLS += target material extras listitems styles qmldir
OTHER_FILES += $$material.files $$extras.files $$listitems.files $$styles.files
配置文件的意图很明确:就是将material、extras、styles、qmldir这些变量对应的文件拷贝到Qt的qml插件目录下的Material文件夹下。
但是 INSTALLS 变量,在按下Build按钮之后并没有执行拷贝操作
需要在Qt Creator中配置一下该项目:
这样子设置以后,按下build之后,就会在make完之后,继续执行INSTALLS的拷贝操作