mirror of https://github.com/qt/qt3d.git
revamp the build/install targets of auxilliary files
files will now always be copied to the build dir, and install targets will be created always as well. Change-Id: I42a57d7fb6536ec3e5ade088f02872484891507e Reviewed-by: Sarah Jane Smith <sarah.j.smith@nokia.com>
This commit is contained in:
parent
a4628855ee
commit
bb6251a7a0
44
README
44
README
|
|
@ -81,44 +81,18 @@ This section is only for those developing Qt3D. Read on to discover how
|
||||||
the building of packages works. This section is also important if you want to
|
the building of packages works. This section is also important if you want to
|
||||||
change how the structure of the Qt3D pro files work.
|
change how the structure of the Qt3D pro files work.
|
||||||
|
|
||||||
Qt3D is intended to be built in one of two ways:
|
To build Qt3D, run:
|
||||||
|
|
||||||
1) Normal developer way:
|
|
||||||
qmake && make
|
qmake && make
|
||||||
2) Package creation way:
|
|
||||||
qmake CONFIG+=package && INSTALL_ROOT=tmp make install
|
|
||||||
|
|
||||||
In 1) the .pro files will cause the toolchain to place the libraries, plugins
|
The .pro files will cause the toolchain to place the libraries, QML files and
|
||||||
header files and other components of Qt3D directly into place, as part of
|
meshes of Qt3D directly into place, as part of the compile process. The files
|
||||||
the compile process. What does "in place" mean? Run "qmake -query" to see
|
go into the bin/ directory, and the executables can be run directly from there.
|
||||||
the paths where the files are placed - QML plugins go in $$[QT_INSTALL_IMPORTS]
|
If you are doing a developer build, plugins will be installed in such a way
|
||||||
for example. In this mode, there is no need to run "make install" because the
|
that Qt will find them.
|
||||||
files are already in their target destination. Here the "target destination"
|
|
||||||
means the Qt which is being built against.
|
|
||||||
|
|
||||||
First note that Qt3D has to be installed into the target Qt. This is because
|
|
||||||
Qt3D has QML plugins and resources, as well as shared libraries, all of which
|
|
||||||
must be resolved by the QMLViewer of the target Qt at runtime. Here where "qmake"
|
|
||||||
is referred to it means the qmake inside the target Qt. Since QtQml
|
|
||||||
recommends using QMLViewer when developing and debugging QML Apps, in the developer
|
|
||||||
case - which is what Qt3D is for - it has to install directly into the target Qt.
|
|
||||||
|
|
||||||
In this mode 1) after the main library is compiled subsequent targets can simply
|
|
||||||
resolve includes and link time dependencies by use of qt3d.prf and qtquick3d.prf.
|
|
||||||
These two files are installed into the target Qt's makespecs/features directory
|
|
||||||
during the processing of the qt3d.pro file.
|
|
||||||
|
|
||||||
In 2) the libraries, plugins and so on are sitting inside the build tree after
|
|
||||||
the compile step. As a result in order to resolve includes and dependencies
|
|
||||||
the build system has to navigate the build tree with paths like "-L../../../threed"
|
|
||||||
to locate the Qt3D libraries.
|
|
||||||
|
|
||||||
Actually there is one build artifact that is not just left where it lands in the
|
|
||||||
build tree - the header files. These are actually copied into an "include"
|
|
||||||
directory inside the build root directory. This is because at present the header
|
|
||||||
files all live inside their own seperate subdirectories under "threed" and would
|
|
||||||
be too cumbersome to path in explicitly.
|
|
||||||
|
|
||||||
After building the tree the install step is invoked using the INSTALL_ROOT environment
|
After building the tree the install step is invoked using the INSTALL_ROOT environment
|
||||||
export to cause the installation rules to place all the files into a sandboxed
|
export to cause the installation rules to place all the files into a sandboxed
|
||||||
install tree, ready for packaging.
|
install tree, ready for packaging:
|
||||||
|
|
||||||
|
INSTALL_ROOT=tmp make install
|
||||||
|
|
|
||||||
76
pkg.pri
76
pkg.pri
|
|
@ -3,26 +3,16 @@
|
||||||
# qmlres.cpp. Once Qt5 is stable and deployment is clear this will be
|
# qmlres.cpp. Once Qt5 is stable and deployment is clear this will be
|
||||||
# removed. Also check the README file.
|
# removed. Also check the README file.
|
||||||
|
|
||||||
package {
|
|
||||||
# default install path for packaging qml resources - package case
|
|
||||||
resource_dir = $$[QT_INSTALL_DATA]/qt3d/resources/$$CATEGORY/$${TARGET}
|
|
||||||
} else {
|
|
||||||
# if we're not packaging, build all our demos/examples/etc and supporting files
|
|
||||||
# into $BUILD_DIR/bin
|
|
||||||
DESTDIR = ../../../bin
|
|
||||||
|
|
||||||
# default install path for packaging qml resources - developer case
|
|
||||||
resource_dir = $$DESTDIR/resources/$$CATEGORY/$${TARGET}
|
|
||||||
}
|
|
||||||
|
|
||||||
# package the binary wrapper that launches the QML
|
# package the binary wrapper that launches the QML
|
||||||
package {
|
target.path = $$[QT_INSTALL_DATA]/qt3d
|
||||||
macx: resource_dir = $$[QT_INSTALL_DATA]/qt3d/$${TARGET}.app/Contents/Resources
|
INSTALLS += target
|
||||||
target.path = $$[QT_INSTALL_DATA]/qt3d
|
|
||||||
INSTALLS += target
|
macx: \
|
||||||
} else {
|
resource_dir = $${TARGET}.app/Contents/Resources
|
||||||
macx: resource_dir = $$DESTDIR/$${TARGET}.app/Contents/Resources
|
else: \
|
||||||
}
|
resource_dir = resources/$$CATEGORY/$${TARGET}
|
||||||
|
|
||||||
|
DESTDIR = $$shadowed($$PWD)/bin
|
||||||
|
|
||||||
# The QML_INFRA_FILES and QML_MESHES_FILES are both about QML based
|
# The QML_INFRA_FILES and QML_MESHES_FILES are both about QML based
|
||||||
# applications, so we'll install them into QT_INSTALL_DATA instead of
|
# applications, so we'll install them into QT_INSTALL_DATA instead of
|
||||||
|
|
@ -38,57 +28,33 @@ package {
|
||||||
!isEmpty(QML_INFRA_FILES) {
|
!isEmpty(QML_INFRA_FILES) {
|
||||||
|
|
||||||
# rules to copy files from the *base level* of $$PWD/qml into the right place
|
# rules to copy files from the *base level* of $$PWD/qml into the right place
|
||||||
package {
|
|
||||||
copyqmlinfra_install.files = $$QML_INFRA_FILES
|
copyqmlinfra_install.files = $$QML_INFRA_FILES
|
||||||
copyqmlinfra_install.path = $$resource_dir/qml
|
copyqmlinfra_install.path = $$target.path/$$resource_dir/qml
|
||||||
INSTALLS += copyqmlinfra_install
|
INSTALLS += copyqmlinfra_install
|
||||||
} else {
|
|
||||||
# if we're not packaging, put all our demos/examples and supporting files
|
# put all our demos/examples and supporting files into $BUILD_DIR/bin
|
||||||
# into $BUILD_DIR/bin
|
target_dir = $$DESTDIR/$$resource_dir/qml
|
||||||
target_dir = $$resource_dir/qml
|
|
||||||
target_dir ~= s,/,$$QMAKE_DIR_SEP,
|
|
||||||
# create extra qmake compiler to copy files across during build step
|
# create extra qmake compiler to copy files across during build step
|
||||||
copyqmlinfra.input = QML_INFRA_FILES
|
copyqmlinfra.input = QML_INFRA_FILES
|
||||||
copyqmlinfra.output = $$target_dir/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT}
|
copyqmlinfra.output = $$target_dir/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT}
|
||||||
!win32|if(win32-g++:!isEmpty(QMAKE_SH)) {
|
copyqmlinfra.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
|
||||||
# in mac, linux, and windows-with-mingw $$QMAKE_MKDIR has -p so this will always work
|
copyqmlinfra.CONFIG += no_link no_clean
|
||||||
copyqmlinfra.commands = $$QMAKE_MKDIR $$target_dir && $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
|
|
||||||
} else {
|
|
||||||
# If we are in windows, and not a mingw shell, then the mkdir binary does not handle
|
|
||||||
# the -p switch, and will fail if the directory already exists, so make it subject to
|
|
||||||
# an "exists" test. The parens are necessary otherwise the copy won't occur when the
|
|
||||||
# test fails, since $$QMAKE_CHK_DIR_EXISTS is "IF NOT EXISTS"
|
|
||||||
copyqmlinfra.commands = ($$QMAKE_CHK_DIR_EXISTS $$target_dir $$QMAKE_MKDIR $$target_dir) && $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
|
|
||||||
}
|
|
||||||
copyqmlinfra.CONFIG += no_link_no_clean
|
|
||||||
copyqmlinfra.variable_out = POST_TARGETDEPS
|
copyqmlinfra.variable_out = POST_TARGETDEPS
|
||||||
QMAKE_EXTRA_COMPILERS += copyqmlinfra
|
QMAKE_EXTRA_COMPILERS += copyqmlinfra
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
!isEmpty(QML_MESHES_FILES) {
|
!isEmpty(QML_MESHES_FILES) {
|
||||||
|
|
||||||
# rules to copy files from the *base level* of $$PWD/qml/meshes into the right place
|
# rules to copy files from the *base level* of $$PWD/qml/meshes into the right place
|
||||||
package {
|
|
||||||
copyqmlmeshes_install.files = $$QML_MESHES_FILES
|
copyqmlmeshes_install.files = $$QML_MESHES_FILES
|
||||||
copyqmlmeshes_install.path = $$resource_dir/qml/meshes
|
copyqmlmeshes_install.path = $$target.path/$$resource_dir/qml/meshes
|
||||||
INSTALLS += copyqmlmeshes_install
|
INSTALLS += copyqmlmeshes_install
|
||||||
} else {
|
|
||||||
target_dir = $$resource_dir/qml/meshes
|
target_dir = $$DESTDIR/$$resource_dir/qml/meshes
|
||||||
target_dir ~= s,/,$$QMAKE_DIR_SEP,
|
|
||||||
copyqmlmeshes.input = QML_MESHES_FILES
|
copyqmlmeshes.input = QML_MESHES_FILES
|
||||||
copyqmlmeshes.output = $$target_dir/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT}
|
copyqmlmeshes.output = $$target_dir/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT}
|
||||||
!win32|if(win32-g++:!isEmpty(QMAKE_SH)) {
|
copyqmlmeshes.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
|
||||||
# in mac, linux, and windows-with-mingw $$QMAKE_MKDIR has -p so this will always work
|
copyqmlmeshes.CONFIG += no_link no_clean
|
||||||
copyqmlmeshes.commands = $$QMAKE_MKDIR $$target_dir && $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
|
|
||||||
} else {
|
|
||||||
# If we are in windows, and not a mingw shell, then the mkdir binary does not handle
|
|
||||||
# the -p switch, and will fail if the directory already exists, so make it subject to
|
|
||||||
# an "exists" test. The parens are necessary otherwise the copy won't occur when the
|
|
||||||
# test fails, since $$QMAKE_CHK_DIR_EXISTS is "IF NOT EXISTS"
|
|
||||||
copyqmlmeshes.commands = ($$QMAKE_CHK_DIR_EXISTS $$target_dir $$QMAKE_MKDIR $$target_dir) && $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
|
|
||||||
}
|
|
||||||
copyqmlmeshes.CONFIG += no_link_no_clean
|
|
||||||
copyqmlmeshes.variable_out = POST_TARGETDEPS
|
copyqmlmeshes.variable_out = POST_TARGETDEPS
|
||||||
QMAKE_EXTRA_COMPILERS += copyqmlmeshes
|
QMAKE_EXTRA_COMPILERS += copyqmlmeshes
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,18 +33,16 @@ QML_INFRA_FILES = \
|
||||||
library.xml \
|
library.xml \
|
||||||
plugins.qmltypes
|
plugins.qmltypes
|
||||||
|
|
||||||
package {
|
copyqmlinfra_install.files = $$QML_INFRA_FILES
|
||||||
copyqmlinfra_install.files = $$QML_INFRA_FILES
|
copyqmlinfra_install.path = $$[QT_INSTALL_IMPORTS]/Qt3D
|
||||||
copyqmlinfra_install.path = $$[QT_INSTALL_IMPORTS]/Qt3D
|
INSTALLS += copyqmlinfra_install
|
||||||
INSTALLS += copyqmlinfra_install
|
|
||||||
} else {
|
copyqmlinfra.input = QML_INFRA_FILES
|
||||||
copyqmlinfra.input = QML_INFRA_FILES
|
copyqmlinfra.output = $$DESTDIR/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT}
|
||||||
copyqmlinfra.output = $$[QT_INSTALL_IMPORTS]/Qt3D/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT}
|
copyqmlinfra.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
|
||||||
copyqmlinfra.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
|
copyqmlinfra.CONFIG += no_link no_clean
|
||||||
copyqmlinfra.CONFIG += no_link_no_clean
|
copyqmlinfra.variable_out = PRE_TARGETDEPS
|
||||||
copyqmlinfra.variable_out = PRE_TARGETDEPS
|
QMAKE_EXTRA_COMPILERS += copyqmlinfra
|
||||||
QMAKE_EXTRA_COMPILERS += copyqmlinfra
|
|
||||||
}
|
|
||||||
|
|
||||||
OTHER_FILES += \
|
OTHER_FILES += \
|
||||||
README.plugins_types \
|
README.plugins_types \
|
||||||
|
|
|
||||||
|
|
@ -59,18 +59,16 @@ QML_INFRA_FILES += \
|
||||||
teapot.bez
|
teapot.bez
|
||||||
# see the file README.library_xml for more on library.xml
|
# see the file README.library_xml for more on library.xml
|
||||||
|
|
||||||
package {
|
copyqmlinfra_install.files = $$QML_INFRA_FILES
|
||||||
copyqmlinfra_install.files = $$QML_INFRA_FILES
|
copyqmlinfra_install.path = $$[QT_INSTALL_IMPORTS]/Qt3D/Shapes
|
||||||
copyqmlinfra_install.path = $$[QT_INSTALL_IMPORTS]/Qt3D/Shapes
|
INSTALLS += copyqmlinfra_install
|
||||||
INSTALLS += copyqmlinfra_install
|
|
||||||
} else {
|
copyqmlinfra.input = QML_INFRA_FILES
|
||||||
copyqmlinfra.input = QML_INFRA_FILES
|
copyqmlinfra.output = $$QT.3dquick.imports/Qt3D/Shapes/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT}
|
||||||
copyqmlinfra.output = $$[QT_INSTALL_IMPORTS]/Qt3D/Shapes/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT}
|
copyqmlinfra.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
|
||||||
copyqmlinfra.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
|
copyqmlinfra.CONFIG += no_link no_clean
|
||||||
copyqmlinfra.CONFIG += no_link_no_clean
|
copyqmlinfra.variable_out = PRE_TARGETDEPS
|
||||||
copyqmlinfra.variable_out = PRE_TARGETDEPS
|
QMAKE_EXTRA_COMPILERS += copyqmlinfra
|
||||||
QMAKE_EXTRA_COMPILERS += copyqmlinfra
|
|
||||||
}
|
|
||||||
|
|
||||||
OTHER_FILES += \
|
OTHER_FILES += \
|
||||||
README.plugins_types \
|
README.plugins_types \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue