Hi everyone!
I never needed this, but today I faced with necessary to copy my QML files of Plugin library to installation folder. This is how looks my ‘*.pro’ file of plugin.
TEMPLATE = lib
TARGET = Msl
QT += qml quick
CONFIG += qt plugin
DESTDIR = com/shav/msl
OBJECTS_DIR = tmp/objects
MOC_DIR = tmp/mocs
TARGET = $$qtLibraryTarget($$TARGET)
uri = com.shav.msl
# Input
SOURCES += \
msl_plugin.cpp \
mslmanager.cpp \
msltexture.cpp \
mslshadow.cpp \
mslgradient.cpp \
msleventcode.cpp \
mslevent.cpp \
mslelement.cpp \
mslcallback.cpp \
mslanimation.cpp \
msl.cpp \
mslinfo.cpp \
mslanimationframe.cpp \
mslcontroller.cpp \
mslstyle.cpp \
mslappearanceinfo.cpp \
msltextattribute.cpp \
mslnsmutableparagraphstyle.cpp \
mslremoterequest.cpp \
msllistmodel.cpp \
mslhelpers.cpp \
mslviewitem.cpp \
mslcontrolleritem.cpp
HEADERS += \
msl_plugin.h \
mslmanager.h \
msltexture.h \
mslshadow.h \
mslgradient.h \
msleventcode.h \
mslevent.h \
mslelement.h \
mslconstants.h \
mslcallback.h \
mslanimation.h \
msl.h \
mslinfo.h \
mslanimationframe.h \
mslcontroller.h \
mslstyle.h \
mslappearanceinfo.h \
msltextattribute.h \
mslnsmutableparagraphstyle.h \
mslremoterequest.h \
msllistmodel.h \
mslhelpers.h \
mslviewitem.h \
mslcontrolleritem.h
OTHER_FILES = qmldir \
MslQmlControllerItem.qml
!equals(_PRO_FILE_PWD_, $$OUT_PWD) {
copy_qmldir.target = $$OUT_PWD/$$DESTDIR/qmldir
copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir
copy_qmldir.commands = $(COPY_FILE) \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\"
QMAKE_EXTRA_TARGETS += copy_qmldir
PRE_TARGETDEPS += $$copy_qmldir.target
}
qmldir.files = qmldir
unix {
installPath = $$[QT_INSTALL_IMPORTS]/$$replace(uri, \\., /)
qmldir.path = $$installPath
target.path = $$installPath
INSTALLS += target qmldir
}
HEADERS += \
mslerrorobject.h
SOURCES += \
mslerrorobject.cpp
I need to copy file ‘MslQmlControllerItem.qml’ to the target folder. What I must add to the “*.pro” file to copy all qml files.
Thanks for the any help!
↧