diff options
author | Sarah Smith <sarah.j.smith@nokia.com> | 2011-04-04 20:35:10 +1000 |
---|---|---|
committer | Sarah Smith <sarah.j.smith@nokia.com> | 2011-04-04 20:35:10 +1000 |
commit | ce4b14604cb967e0b6160afa738420580d4b2cf3 (patch) | |
tree | 41aa00b1c04ee8929eec831f44b181b95c885bae | |
parent | ce5d8672678f64afbdd67b7992362693f516c43d (diff) |
Packaging round one done.
See QTBUG-17434 for more details.
Packaging on a debian desktop system works. Tested with Ubuntu 10.10
which is currently one of few with Qt 4.7.x packages.
85 files changed, 875 insertions, 1233 deletions
diff --git a/debian/libqt4-3d-examples.install b/debian/libqt4-3d-examples.install index 610e3dc20..130f8c80f 100644 --- a/debian/libqt4-3d-examples.install +++ b/debian/libqt4-3d-examples.install @@ -1,2 +1,2 @@ usr/bin/* -usr/share/qt4/demos/declarative/ +usr/share/qt4/quick3d diff --git a/debian/rules b/debian/rules index 70021466d..2ed9da76f 100755 --- a/debian/rules +++ b/debian/rules @@ -2,9 +2,22 @@ # -*- makefile -*- # To build using this rules file: -# mkdir qt3d-1.0 -# (cd ~/depot/research/qt3d && tar cf - --exclude-vcs .)|(cd qt3d-1.0 && tar xvpf -) -# cd qt3d-1.0 +# # +# ### install debian packaging stuff if not already present: +# sudo apt-get install dpkg-dev debhelper cdbs +# +# ### set up the build directory with version number - DO NOT CD INTO IT YET! +# mkdir quick3d-tp1 +# +# ### copy all the stuff across - cannot shadow build (probably don't want git) +# (cd ~/depot/qt/quick3d && tar cf - --exclude-vcs .)|(cd quick3d-tp1 && tar xf -) +# +# ### if the qmake in the $PATH is not the Qt you want to use +# ### you can use a binary package or a Qt built from source (even if its installed with +# ### "make install") as long as it has declarative & opengl +# # export PATH=/usr/local/Trolltech/Qt-4.7.2/bin:$PATH +# +# cd quick3d-tp1 # export DEB_BUILD_OPTIONS="parallel=4" # dpkg-buildpackage -b @@ -22,15 +35,14 @@ ifneq (,$(filter parallel=%,$(TMP_BUILD_OPTS))) PARALLEL_MAKEFLAGS += -j$(NUMJOBS) endif +ifeq (arm,$(findstring arm,$(shell g++ -v 2>&1 | sed -n '/Target: arm/p'))) + QMAKE_CONF_MKSPEC = "-spec linux-g++-maemo" + QMAKE_CONF_OPTS = "CONFIG+=maemo" +endif + DEB_MAKE_INVOKE := $(MAKE) $(PARALLEL_MAKEFLAGS) DEB_MAKE_INSTALL_TARGET := INSTALL_ROOT=$(DEB_DESTDIR) install DEB_DH_INSTALL_SOURCEDIR := debian/tmp common-configure-arch:: - qmake -spec linux-g++-maemo opengl.pro CONFIG+=maemo - -common-install-arch:: install-examples - -install-examples: - cp -a bin $(DEB_DESTDIR)/usr - cp -a demos/declarative $(DEB_DESTDIR)/usr/share/qt4 + qmake $(QMAKE_CONF_MKSPEC) quick3d.pro $(QMAKE_CONF_OPTS) CONFIG+=package diff --git a/demos/qt3d/cubehouse/cubehouse.pro b/demos/qt3d/cubehouse/cubehouse.pro index 70ee226aa..93da6e01c 100644 --- a/demos/qt3d/cubehouse/cubehouse.pro +++ b/demos/qt3d/cubehouse/cubehouse.pro @@ -1,12 +1,22 @@ TEMPLATE = app TARGET = cubehouse -CONFIG += qt warn_on qt3d +CONFIG += qt warn_on +!package: CONFIG += qt3d + SOURCES = cubeview.cpp main.cpp projectivetextureeffect.cpp HEADERS = cubeview.h projectivetextureeffect.h win32:DEFINES+=_CRT_SECURE_NO_WARNINGS RESOURCES = cube.qrc -DESTDIR = ../../bin OTHER_FILES += \ shaders/objectlineartexgen.frag \ shaders/objectlineartexgen.vert + +package { + LIBS += -L../../../src/threed -lQt3D + INCLUDEPATH += ../../../include + target.path += $$[QT_INSTALL_BINS] + INSTALLS += target +} else { + DESTDIR = ../../../bin +} diff --git a/demos/qt3d/pageflip/pageflip.pro b/demos/qt3d/pageflip/pageflip.pro index 4d94c8e8c..e676d27cc 100644 --- a/demos/qt3d/pageflip/pageflip.pro +++ b/demos/qt3d/pageflip/pageflip.pro @@ -1,7 +1,17 @@ TEMPLATE = app TARGET = pageflip -CONFIG += qt warn_on qt3d +CONFIG += qt warn_on +!package: CONFIG += qt3d + SOURCES = pageflip.cpp pageflipmath.cpp HEADERS = pageflipmath_p.h RESOURCES = pageflip.qrc -DESTDIR = ../../bin + +package { + LIBS += -L../../../src/threed -lQt3D + INCLUDEPATH += ../../../include + target.path += $$[QT_INSTALL_BINS] + INSTALLS += target +} else { + DESTDIR = ../../../bin +} diff --git a/demos/qt3d/photobrowser3d/photobrowser3d.pro b/demos/qt3d/photobrowser3d/photobrowser3d.pro index b5c695bca..549d09f5a 100644 --- a/demos/qt3d/photobrowser3d/photobrowser3d.pro +++ b/demos/qt3d/photobrowser3d/photobrowser3d.pro @@ -1,6 +1,9 @@ TEMPLATE = app TARGET = photobrowser3d -CONFIG += qt warn_on qt3d +CONFIG += qt warn_on +!package: CONFIG += qt3d +package: QT += opengl + SOURCES += main.cpp\ photobrowser3dview.cpp \ imagedisplay.cpp \ @@ -47,12 +50,19 @@ HEADERS += photobrowser3dview.h \ RESOURCES += \ photobrowser3d.qrc -DESTDIR = ../../bin - OTHER_FILES += \ shaders/replace_texture.fsh \ shaders/replace_texture.vsh +package { + LIBS += -L../../../src/threed -lQt3D + INCLUDEPATH += ../../../include + target.path += $$[QT_INSTALL_BINS] + INSTALLS += target +} else { + DESTDIR = ../../../bin +} + symbian { symbian-abld|symbian-sbsv2 { # ro-section in photobrowser3d can exceed default allocated space, so move rw-section a little further @@ -60,3 +70,4 @@ symbian { QMAKE_LFLAGS.GCCE += -Tdata 0xC00000 } } + diff --git a/demos/qt3d/qt3d.pro b/demos/qt3d/qt3d.pro index d506a9909..90e858a39 100644 --- a/demos/qt3d/qt3d.pro +++ b/demos/qt3d/qt3d.pro @@ -1,2 +1,2 @@ TEMPLATE = subdirs -SUBDIRS = teaservice shapes pageflip photobrowser3d cubehouse +SUBDIRS = teaservice shapes pageflip cubehouse photobrowser3d diff --git a/demos/qt3d/shapes/shapes.pro b/demos/qt3d/shapes/shapes.pro index 499c134c0..5e656eaa6 100644 --- a/demos/qt3d/shapes/shapes.pro +++ b/demos/qt3d/shapes/shapes.pro @@ -1,5 +1,15 @@ TEMPLATE = app TARGET = shapes -CONFIG += qt warn_on qt3d +CONFIG += qt warn_on +!package: CONFIG += qt3d + SOURCES = shapes.cpp -DESTDIR = ../../bin + +package { + LIBS += -L../../../src/threed -lQt3D + INCLUDEPATH += ../../../include + target.path += $$[QT_INSTALL_BINS] + INSTALLS += target +} else { + DESTDIR = ../../../bin +} diff --git a/demos/qt3d/teaservice/teaservice.pro b/demos/qt3d/teaservice/teaservice.pro index e08325de1..c4c306cf5 100644 --- a/demos/qt3d/teaservice/teaservice.pro +++ b/demos/qt3d/teaservice/teaservice.pro @@ -1,7 +1,17 @@ TEMPLATE = app TARGET = teaservice -CONFIG += qt warn_on qt3d +CONFIG += qt warn_on +!package: CONFIG += qt3d + SOURCES = teaservice.cpp meshobject.cpp sceneobject.cpp perpixeleffect.cpp HEADERS = meshobject.h sceneobject.h perpixeleffect.h RESOURCES = teaservice.qrc -DESTDIR = ../../bin + +package { + LIBS += -L../../../src/threed -lQt3D + INCLUDEPATH += ../../../include + target.path += $$[QT_INSTALL_BINS] + INSTALLS += target +} else { + DESTDIR = ../../../bin +} diff --git a/demos/quick3d/model_viewer/main.cpp b/demos/quick3d/model_viewer/main.cpp index ff59d7023..ab6547065 100644 --- a/demos/quick3d/model_viewer/main.cpp +++ b/demos/quick3d/model_viewer/main.cpp @@ -42,7 +42,7 @@ #include <QtGui/QApplication> #include <QtDeclarative/qdeclarativeview.h> -#include "qmlres.h" +#include "../qmlres.h" int main(int argc, char *argv[]) { diff --git a/demos/quick3d/model_viewer/model_viewer.pro b/demos/quick3d/model_viewer/model_viewer.pro index cf11936fd..605ff448d 100644 --- a/demos/quick3d/model_viewer/model_viewer.pro +++ b/demos/quick3d/model_viewer/model_viewer.pro @@ -3,11 +3,11 @@ TARGET = model_viewer CONFIG += qt warn_on SOURCES += main.cpp -HEADERS += qmlres.h +HEADERS += ../qmlres.h QT += declarative -DESTDIR = ../../../bin/$$TARGET +!package:DESTDIR = ../../../bin qmlResources.files = qml symbian { @@ -17,7 +17,23 @@ symbian { qmlResources.path = Contents/Resources QMAKE_BUNDLE_DATA += qmlResources } else { - qmlResources.path = $$OUT_PWD/../../../bin/$${TARGET}_resources/qml - INSTALLS += qmlResources + !package { + qmlResources.input = qmlResources.files + qmlResources.output = $$OUT_PWD/../../../bin/resources/demos/$$TARGET/qml + qmlResources.commands = $$QMAKE_COPY_DIR ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + qmlResources.CONFIG += no_link_no_clean + qmlResources.variable_out = POST_TARGETDEPS + QMAKE_EXTRA_COMPILERS += qmlResources + } } } + +# for make install use in packages +distInstalls.files = qml +distInstalls.path = $$[QT_INSTALL_DATA]/quick3d/demos/$$TARGET +INSTALLS += distInstalls + +package { + target.path = $$[QT_INSTALL_BINS] + INSTALLS += target +} diff --git a/demos/quick3d/model_viewer/qmlres.h b/demos/quick3d/model_viewer/qmlres.h deleted file mode 100644 index a027c35e5..000000000 --- a/demos/quick3d/model_viewer/qmlres.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#ifndef QMLRES_H -#define QMLRES_H - -#include <QtCore/qdir.h> - -static inline QString q_get_qmldir(const QString &name) -{ - QString qml = name; - QDir dir = QApplication::applicationDirPath(); - QString resDir = QApplication::applicationName() + QLatin1String("_resources"); - if (dir.path().endsWith(QLatin1String("MacOS"))) - { - // inside an app bundle - get qml resources from there - dir.cdUp(); - dir.cd(QLatin1String("Resources")); - qml = dir.filePath(qml); - } - else if (dir.exists(resDir)) - { - qml = dir.filePath(qml.prepend(resDir)); - } - return qml; -} - -#endif // QMLRES_H diff --git a/demos/quick3d/qmlres.h b/demos/quick3d/qmlres.h new file mode 100644 index 000000000..8c04e00ff --- /dev/null +++ b/demos/quick3d/qmlres.h @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#ifndef QMLRES_H +#define QMLRES_H + +#include <QtCore/qdir.h> +#include <QtCore/qcoreapplication.h> + +#include <QtCore/qdebug.h> + +/*! + \internal + Returns a string with the path to qml resources, including qml sources, + 3D assets and textures. The path depends on the platform, and (for + some platforms) whether it was installed from a package or is being run + in a development setting. +*/ +static QString q_get_qmldir(const QString &name) +{ + QString qml = name; + // try for a Linux package install first + QDir pkgdir(QLatin1String("/usr/share/qt4/quick3d/demos")); + if (pkgdir.cd(QCoreApplication::applicationName()) + && pkgdir.exists()) + { + qml = pkgdir.filePath(qml); + } + else + { + // failing that try Mac (pkg & dev) next + QDir dir(QCoreApplication::applicationDirPath()); + if (dir.path().endsWith(QLatin1String("MacOS"))) + { + if (dir.cdUp() && dir.cd(QLatin1String("Resources")) + && dir.exists()) + { + qml = dir.filePath(qml); + } + else + { + qWarning("Expected app bundle with QML resources!"); + } + } + else + { + // for Windows (pkg & dev), and for Linux dev expect to find it + // in a "resources" directory next to the binary + if (dir.cd(QLatin1String("resources")) && dir.exists()) + { + QString app = QCoreApplication::applicationFilePath(); + app = app.section(QDir::separator(), -1); + if (dir.cd(QLatin1String("demos")) && dir.cd(app) && dir.exists()) + { + qml = dir.filePath(qml); + } + else + { + QString msg = QLatin1String("demos"); + msg += QDir::separator(); + msg += QCoreApplication::applicationName(); + qWarning("Expected %s directry with qml resources!", qPrintable(msg)); + } + } + } + } + return qml; +} + +#endif // QMLRES_H diff --git a/demos/quick3d/robo_bounce/main.cpp b/demos/quick3d/robo_bounce/main.cpp index 16a0e889c..a71e8e9d6 100644 --- a/demos/quick3d/robo_bounce/main.cpp +++ b/demos/quick3d/robo_bounce/main.cpp @@ -42,7 +42,7 @@ #include <QtGui/QApplication> #include <QtDeclarative/qdeclarativeview.h> -#include "qmlres.h" +#include "../qmlres.h" int main(int argc, char *argv[]) { diff --git a/demos/quick3d/robo_bounce/qmlres.h b/demos/quick3d/robo_bounce/qmlres.h deleted file mode 100644 index a027c35e5..000000000 --- a/demos/quick3d/robo_bounce/qmlres.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#ifndef QMLRES_H -#define QMLRES_H - -#include <QtCore/qdir.h> - -static inline QString q_get_qmldir(const QString &name) -{ - QString qml = name; - QDir dir = QApplication::applicationDirPath(); - QString resDir = QApplication::applicationName() + QLatin1String("_resources"); - if (dir.path().endsWith(QLatin1String("MacOS"))) - { - // inside an app bundle - get qml resources from there - dir.cdUp(); - dir.cd(QLatin1String("Resources")); - qml = dir.filePath(qml); - } - else if (dir.exists(resDir)) - { - qml = dir.filePath(qml.prepend(resDir)); - } - return qml; -} - -#endif // QMLRES_H diff --git a/demos/quick3d/robo_bounce/robo_bounce.pro b/demos/quick3d/robo_bounce/robo_bounce.pro index 17843fa70..ab1929a0b 100644 --- a/demos/quick3d/robo_bounce/robo_bounce.pro +++ b/demos/quick3d/robo_bounce/robo_bounce.pro @@ -3,11 +3,11 @@ TARGET = robo_bounce CONFIG += qt warn_on SOURCES += main.cpp -HEADERS += qmlres.h +HEADERS += ../qmlres.h QT += declarative -DESTDIR = ../../../bin/$$TARGET +!package:DESTDIR = ../../../bin qmlResources.files = qml symbian { @@ -17,7 +17,23 @@ symbian { qmlResources.path = Contents/Resources QMAKE_BUNDLE_DATA += qmlResources } else { - qmlResources.path = $$OUT_PWD/../../../bin/$${TARGET}_resources/qml - INSTALLS += qmlResources + !package { + qmlResources.input = qmlResources.files + qmlResources.output = $$OUT_PWD/../../../bin/resources/demos/$$TARGET/qml + qmlResources.commands = $$QMAKE_COPY_DIR ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + qmlResources.CONFIG += no_link_no_clean + qmlResources.variable_out = POST_TARGETDEPS + QMAKE_EXTRA_COMPILERS += qmlResources + } } } + +# for make install use in packages +distInstalls.files = qml +distInstalls.path = $$[QT_INSTALL_DATA]/quick3d/demos/$$TARGET +INSTALLS += distInstalls + +package { + target.path = $$[QT_INSTALL_BINS] + INSTALLS += target +} diff --git a/demos/quick3d/tea_service/main.cpp b/demos/quick3d/tea_service/main.cpp index 8695e3f5f..252cc2fbc 100644 --- a/demos/quick3d/tea_service/main.cpp +++ b/demos/quick3d/tea_service/main.cpp @@ -42,7 +42,7 @@ #include <QtGui/QApplication> #include <QtDeclarative/qdeclarativeview.h> -#include "qmlres.h" +#include "../qmlres.h" int main(int argc, char *argv[]) { diff --git a/demos/quick3d/tea_service/qmlres.h b/demos/quick3d/tea_service/qmlres.h deleted file mode 100644 index a027c35e5..000000000 --- a/demos/quick3d/tea_service/qmlres.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#ifndef QMLRES_H -#define QMLRES_H - -#include <QtCore/qdir.h> - -static inline QString q_get_qmldir(const QString &name) -{ - QString qml = name; - QDir dir = QApplication::applicationDirPath(); - QString resDir = QApplication::applicationName() + QLatin1String("_resources"); - if (dir.path().endsWith(QLatin1String("MacOS"))) - { - // inside an app bundle - get qml resources from there - dir.cdUp(); - dir.cd(QLatin1String("Resources")); - qml = dir.filePath(qml); - } - else if (dir.exists(resDir)) - { - qml = dir.filePath(qml.prepend(resDir)); - } - return qml; -} - -#endif // QMLRES_H diff --git a/demos/quick3d/tea_service/tea_service.pro b/demos/quick3d/tea_service/tea_service.pro index 13238a458..8d2f332df 100644 --- a/demos/quick3d/tea_service/tea_service.pro +++ b/demos/quick3d/tea_service/tea_service.pro @@ -3,11 +3,11 @@ TARGET = tea_service CONFIG += qt warn_on SOURCES += main.cpp -HEADERS += qmlres.h +HEADERS += ../qmlres.h QT += declarative -DESTDIR = ../../../bin/$$TARGET +!package:DESTDIR = ../../../bin qmlResources.files = qml symbian { @@ -17,7 +17,23 @@ symbian { qmlResources.path = Contents/Resources QMAKE_BUNDLE_DATA += qmlResources } else { - qmlResources.path = $$OUT_PWD/../../../bin/$${TARGET}_resources/qml - INSTALLS += qmlResources + !package { + qmlResources.input = qmlResources.files + qmlResources.output = $$OUT_PWD/../../../bin/resources/demos/$$TARGET/qml + qmlResources.commands = $$QMAKE_COPY_DIR ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + qmlResources.CONFIG += no_link_no_clean + qmlResources.variable_out = POST_TARGETDEPS + QMAKE_EXTRA_COMPILERS += qmlResources + } } } + +# for make install use in packages +distInstalls.files = qml +distInstalls.path = $$[QT_INSTALL_DATA]/quick3d/demos/$$TARGET +INSTALLS += distInstalls + +package { + target.path = $$[QT_INSTALL_BINS] + INSTALLS += target +} diff --git a/examples/qt3d/basket/basket.pro b/examples/qt3d/basket/basket.pro index 1b0404a70..c56301271 100644 --- a/examples/qt3d/basket/basket.pro +++ b/examples/qt3d/basket/basket.pro @@ -1,7 +1,17 @@ TEMPLATE = app TARGET = basket -CONFIG += qt warn_on qt3d +CONFIG += qt warn_on +!package: CONFIG += qt3d + SOURCES = basketview.cpp main.cpp HEADERS = basketview.h basket_data.h RESOURCES = basket.qrc -DESTDIR = ../../../bin + +package { + LIBS += -L../../../src/threed -lQt3D + INCLUDEPATH += ../../../include + target.path += $$[QT_INSTALL_BINS] + INSTALLS += target +} else { + DESTDIR = ../../../bin +} diff --git a/examples/qt3d/builder/builder.pro b/examples/qt3d/builder/builder.pro index 2fac6f330..f56e0ab0e 100644 --- a/examples/qt3d/builder/builder.pro +++ b/examples/qt3d/builder/builder.pro @@ -1,8 +1,19 @@ TEMPLATE = app TARGET = builder -CONFIG += qt warn_on qt3d +CONFIG += qt warn_on +!package: CONFIG += qt3d + SOURCES = builder.cpp \ main.cpp HEADERS = builder.h -DESTDIR = ../../bin RESOURCES += builder.qrc + +package { + LIBS += -L../../../src/threed -lQt3D + INCLUDEPATH += ../../../include + target.path += $$[QT_INSTALL_BINS] + INSTALLS += target +} else { + DESTDIR = ../../../bin +} + diff --git a/examples/qt3d/cube/cube.pro b/examples/qt3d/cube/cube.pro index ec2bc6967..09f049182 100644 --- a/examples/qt3d/cube/cube.pro +++ b/examples/qt3d/cube/cube.pro @@ -1,7 +1,18 @@ TEMPLATE = app TARGET = cube -CONFIG += qt warn_on qt3d +CONFIG += qt warn_on + +!package: CONFIG += qt3d + SOURCES = cubeview.cpp main.cpp HEADERS = cubeview.h RESOURCES = cube.qrc -DESTDIR = ../../bin + +package { + LIBS += -L../../../src/threed -lQt3D + INCLUDEPATH += ../../../include + target.path += $$[QT_INSTALL_BINS] + INSTALLS += target +} else { + DESTDIR = ../../../bin +} diff --git a/examples/qt3d/cylinder/cylinder.pro b/examples/qt3d/cylinder/cylinder.pro index ee018cb9d..7916959bf 100644 --- a/examples/qt3d/cylinder/cylinder.pro +++ b/examples/qt3d/cylinder/cylinder.pro @@ -1,7 +1,17 @@ TEMPLATE = app TARGET = cylinder -CONFIG += qt warn_on qt3d +CONFIG += qt warn_on +!package: CONFIG += qt3d + SOURCES = cylinderview.cpp main.cpp HEADERS = cylinderview.h RESOURCES = cylinder.qrc -DESTDIR = ../../bin + +package { + LIBS += -L../../../src/threed -lQt3D + INCLUDEPATH += ../../../include + target.path += $$[QT_INSTALL_BINS] + INSTALLS += target +} else { + DESTDIR = ../../../bin +} diff --git a/examples/qt3d/geometry/geometry.pro b/examples/qt3d/geometry/geometry.pro index 66025be88..85cbb63db 100644 --- a/examples/qt3d/geometry/geometry.pro +++ b/examples/qt3d/geometry/geometry.pro @@ -1,6 +1,9 @@ TEMPLATE = app TARGET = geometry -CONFIG += qt warn_on qt3d +CONFIG += qt warn_on + +!package: CONFIG += qt3d + SOURCES = geometryview.cpp \ main.cpp \ geometry.cpp \ @@ -9,4 +12,12 @@ HEADERS = geometryview.h \ geometry.h \ quadplane.h RESOURCES = geometry.qrc -DESTDIR = ../../bin + +package { + LIBS += -L../../../src/threed -lQt3D + INCLUDEPATH += ../../../include + target.path += $$[QT_INSTALL_BINS] + INSTALLS += target +} else { + DESTDIR = ../../../bin +} diff --git a/examples/qt3d/graphicsview/graphicsview.pro b/examples/qt3d/graphicsview/graphicsview.pro index 98aba411d..8d5664fe7 100644 --- a/examples/qt3d/graphicsview/graphicsview.pro +++ b/examples/qt3d/graphicsview/graphicsview.pro @@ -1,6 +1,8 @@ TEMPLATE = app TARGET = graphicsview -CONFIG += qt warn_on qt3d +CONFIG += qt warn_on +!package: CONFIG += qt3d + VPATH += $$PWD/../../src/threed/geometry SOURCES = \ cubeitem.cpp \ @@ -23,4 +25,12 @@ HEADERS = \ view.h RESOURCES = \ graphicsview.qrc -DESTDIR = ../../bin + +package { + LIBS += -L../../../src/threed -lQt3D + INCLUDEPATH += ../../../include + target.path += $$[QT_INSTALL_BINS] + INSTALLS += target +} else { + DESTDIR = ../../../bin +} diff --git a/examples/qt3d/nesting/nesting.pro b/examples/qt3d/nesting/nesting.pro index 0ea63d333..47b2a925d 100644 --- a/examples/qt3d/nesting/nesting.pro +++ b/examples/qt3d/nesting/nesting.pro @@ -1,7 +1,17 @@ TEMPLATE = app TARGET = nesting -CONFIG += qt warn_on qt3d +CONFIG += qt warn_on +!package: CONFIG += qt3d + SOURCES = cubeview.cpp main.cpp HEADERS = cubeview.h RESOURCES = nesting.qrc -DESTDIR = ../../bin + +package { + LIBS += -L../../../src/threed -lQt3D + INCLUDEPATH += ../../../include + target.path += $$[QT_INSTALL_BINS] + INSTALLS += target +} else { + DESTDIR = ../../../bin +} diff --git a/examples/qt3d/qt3d.pro b/examples/qt3d/qt3d.pro index a25bb6e91..4aebabdc7 100644 --- a/examples/qt3d/qt3d.pro +++ b/examples/qt3d/qt3d.pro @@ -1,2 +1,3 @@ TEMPLATE = subdirs -SUBDIRS += basket builder cube cylinder geometry graphicsview nesting tank teapot tutorials +SUBDIRS += basket builder cube cylinder geometry graphicsview nesting tank teapot +!package: SUBDIRS += tutorials diff --git a/examples/qt3d/tank/tank.pro b/examples/qt3d/tank/tank.pro index 50b916ff6..418a86bcb 100644 --- a/examples/qt3d/tank/tank.pro +++ b/examples/qt3d/tank/tank.pro @@ -1,6 +1,7 @@ -CONFIG += qt warn_on qt3d TARGET = tank TEMPLATE = app +CONFIG += qt warn_on +!package: CONFIG += qt3d SOURCES += main.cpp\ tankview.cpp \ @@ -11,4 +12,11 @@ HEADERS += tankview.h \ tank.h \ quadplane.h -DESTDIR = ../../bin +package { + LIBS += -L../../../src/threed -lQt3D + INCLUDEPATH += ../../../include + target.path += $$[QT_INSTALL_BINS] + INSTALLS += target +} else { + DESTDIR = ../../../bin +} diff --git a/examples/qt3d/teapot/teapot.pro b/examples/qt3d/teapot/teapot.pro index 1024f6a72..c109e9932 100644 --- a/examples/qt3d/teapot/teapot.pro +++ b/examples/qt3d/teapot/teapot.pro @@ -1,6 +1,16 @@ TEMPLATE = app TARGET = teapot -CONFIG += qt warn_on qt3d +CONFIG += qt warn_on +!package: CONFIG += qt3d + SOURCES = teapotview.cpp main.cpp HEADERS = teapotview.h -DESTDIR = ../../bin + +package { + LIBS += -L../../../src/threed -lQt3D + INCLUDEPATH += ../../../include + target.path += $$[QT_INSTALL_BINS] + INSTALLS += target +} else { + DESTDIR = ../../../bin +} diff --git a/examples/qt3d/tutorials/cube1/cube1.pro b/examples/qt3d/tutorials/cube1/cube1.pro index 51df0efe0..0054518f1 100644 --- a/examples/qt3d/tutorials/cube1/cube1.pro +++ b/examples/qt3d/tutorials/cube1/cube1.pro @@ -3,3 +3,4 @@ TARGET = cube1 CONFIG += qt warn_on qt3d SOURCES = cubeview.cpp main.cpp HEADERS = cubeview.h +DESTDIR = ../../../../bin/qt3d/tutorials diff --git a/examples/qt3d/tutorials/cube2/cube2.pro b/examples/qt3d/tutorials/cube2/cube2.pro index 3bf258831..61f496fd3 100644 --- a/examples/qt3d/tutorials/cube2/cube2.pro +++ b/examples/qt3d/tutorials/cube2/cube2.pro @@ -3,3 +3,4 @@ TARGET = cube2 CONFIG += qt warn_on qt3d SOURCES = cubeview.cpp main.cpp HEADERS = cubeview.h +DESTDIR = ../../../../bin/qt3d/tutorials diff --git a/examples/qt3d/tutorials/cube3/cube3.pro b/examples/qt3d/tutorials/cube3/cube3.pro index 70b049fe2..b61205e2c 100644 --- a/examples/qt3d/tutorials/cube3/cube3.pro +++ b/examples/qt3d/tutorials/cube3/cube3.pro @@ -3,3 +3,4 @@ TARGET = cube3 CONFIG += qt warn_on qt3d SOURCES = cubeview.cpp main.cpp HEADERS = cubeview.h +DESTDIR = ../../../../bin/qt3d/tutorials diff --git a/examples/qt3d/tutorials/cube4/cube4.pro b/examples/qt3d/tutorials/cube4/cube4.pro index a2f4ba79c..46b6c3c2f 100644 --- a/examples/qt3d/tutorials/cube4/cube4.pro +++ b/examples/qt3d/tutorials/cube4/cube4.pro @@ -4,3 +4,4 @@ CONFIG += qt warn_on qt3d SOURCES = cubeview.cpp main.cpp HEADERS = cubeview.h RESOURCES = cube.qrc +DESTDIR = ../../../../bin/qt3d/tutorials diff --git a/examples/qt3d/tutorials/penguin/penguin.pro b/examples/qt3d/tutorials/penguin/penguin.pro index f35c1cd4e..7f179dbf3 100644 --- a/examples/qt3d/tutorials/penguin/penguin.pro +++ b/examples/qt3d/tutorials/penguin/penguin.pro @@ -5,3 +5,4 @@ SOURCES = modelview.cpp \ main.cpp HEADERS = modelview.h RESOURCES = model.qrc +DESTDIR = ../../../../bin/qt3d/tutorials diff --git a/examples/qt3d/tutorials/penguin_advanced/penguin_advanced.pro b/examples/qt3d/tutorials/penguin_advanced/penguin_advanced.pro index 079c5f5b0..0afd13261 100644 --- a/examples/qt3d/tutorials/penguin_advanced/penguin_advanced.pro +++ b/examples/qt3d/tutorials/penguin_advanced/penguin_advanced.pro @@ -1,6 +1,6 @@ TEMPLATE = app TARGET = penguin -DESTDIR = ../../../bin +DESTDIR = ../../../../bin/qt3d/tutorials CONFIG += qt warn_on qt3d SOURCES = modelview.cpp \ main.cpp diff --git a/examples/quick3d/basket/basket.pro b/examples/quick3d/basket/basket.pro index e391666e7..32f9a7df5 100644 --- a/examples/quick3d/basket/basket.pro +++ b/examples/quick3d/basket/basket.pro @@ -3,11 +3,11 @@ TARGET = basket_qml CONFIG += qt warn_on SOURCES += main.cpp -HEADERS += qmlres.h +HEADERS += ../qmlres.h QT += declarative -DESTDIR = ../../../bin/$$TARGET +!package:DESTDIR = ../../../bin qmlResources.files = qml symbian { @@ -17,7 +17,23 @@ symbian { qmlResources.path = Contents/Resources QMAKE_BUNDLE_DATA += qmlResources } else { - qmlResources.path = $$OUT_PWD/../../../bin/$${TARGET}_resources/qml - INSTALLS += qmlResources + !package { + qmlResources.input = qmlResources.files + qmlResources.output = $$OUT_PWD/../../../bin/resources/examples/$$TARGET/qml + qmlResources.commands = $$QMAKE_COPY_DIR ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + qmlResources.CONFIG += no_link_no_clean + qmlResources.variable_out = POST_TARGETDEPS + QMAKE_EXTRA_COMPILERS += qmlResources + } } } + +# for make install use in packages +distInstalls.files = qml +distInstalls.path = $$[QT_INSTALL_DATA]/quick3d/examples/$$TARGET +INSTALLS += distInstalls + +package { + target.path = $$[QT_INSTALL_BINS] + INSTALLS += target +} diff --git a/examples/quick3d/basket/main.cpp b/examples/quick3d/basket/main.cpp index 51aa68740..45fad9a04 100644 --- a/examples/quick3d/basket/main.cpp +++ b/examples/quick3d/basket/main.cpp @@ -43,12 +43,14 @@ #include <QtDeclarative/qdeclarativeview.h> #include <QtCore/qdir.h> -#include "qmlres.h" +#include "../qmlres.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); + qDebug() << "basket_qml"; + QDeclarativeView view; QString qml = q_get_qmldir(QLatin1String("qml/basket.qml")); view.setSource(QUrl::fromLocalFile(qml)); diff --git a/examples/quick3d/basket/qmlres.h b/examples/quick3d/basket/qmlres.h deleted file mode 100644 index a027c35e5..000000000 --- a/examples/quick3d/basket/qmlres.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#ifndef QMLRES_H -#define QMLRES_H - -#include <QtCore/qdir.h> - -static inline QString q_get_qmldir(const QString &name) -{ - QString qml = name; - QDir dir = QApplication::applicationDirPath(); - QString resDir = QApplication::applicationName() + QLatin1String("_resources"); - if (dir.path().endsWith(QLatin1String("MacOS"))) - { - // inside an app bundle - get qml resources from there - dir.cdUp(); - dir.cd(QLatin1String("Resources")); - qml = dir.filePath(qml); - } - else if (dir.exists(resDir)) - { - qml = dir.filePath(qml.prepend(resDir)); - } - return qml; -} - -#endif // QMLRES_H diff --git a/examples/quick3d/bounce/bounce.pro b/examples/quick3d/bounce/bounce.pro index 719a9bf02..b39ecb174 100644 --- a/examples/quick3d/bounce/bounce.pro +++ b/examples/quick3d/bounce/bounce.pro @@ -3,11 +3,11 @@ TARGET = bounce CONFIG += qt warn_on SOURCES += main.cpp -HEADERS += qmlres.h +HEADERS += ../qmlres.h QT += declarative -DESTDIR = ../../../bin/$$TARGET +!package:DESTDIR = ../../../bin qmlResources.files = qml symbian { @@ -17,7 +17,23 @@ symbian { qmlResources.path = Contents/Resources QMAKE_BUNDLE_DATA += qmlResources } else { - qmlResources.path = $$OUT_PWD/../../../bin/$$TARGET.qml - INSTALLS += qmlResources + !package { + qmlResources.input = qmlResources.files + qmlResources.output = $$OUT_PWD/../../../bin/resources/examples/$$TARGET/qml + qmlResources.commands = $$QMAKE_COPY_DIR ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + qmlResources.CONFIG += no_link_no_clean + qmlResources.variable_out = POST_TARGETDEPS + QMAKE_EXTRA_COMPILERS += qmlResources + } } } + +# for make install use in packages +distInstalls.files = qml +distInstalls.path = $$[QT_INSTALL_DATA]/quick3d/examples/$$TARGET +INSTALLS += distInstalls + +package { + target.path = $$[QT_INSTALL_BINS] + INSTALLS += target +} diff --git a/examples/quick3d/bounce/main.cpp b/examples/quick3d/bounce/main.cpp index 5aa4edc09..267aecdf3 100644 --- a/examples/quick3d/bounce/main.cpp +++ b/examples/quick3d/bounce/main.cpp @@ -43,7 +43,7 @@ #include <QtDeclarative/qdeclarativeview.h> #include <QtCore/qdir.h> -#include "qmlres.h" +#include "../qmlres.h" int main(int argc, char *argv[]) { diff --git a/examples/quick3d/bounce/qmlres.h b/examples/quick3d/bounce/qmlres.h deleted file mode 100644 index a027c35e5..000000000 --- a/examples/quick3d/bounce/qmlres.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#ifndef QMLRES_H -#define QMLRES_H - -#include <QtCore/qdir.h> - -static inline QString q_get_qmldir(const QString &name) -{ - QString qml = name; - QDir dir = QApplication::applicationDirPath(); - QString resDir = QApplication::applicationName() + QLatin1String("_resources"); - if (dir.path().endsWith(QLatin1String("MacOS"))) - { - // inside an app bundle - get qml resources from there - dir.cdUp(); - dir.cd(QLatin1String("Resources")); - qml = dir.filePath(qml); - } - else if (dir.exists(resDir)) - { - qml = dir.filePath(qml.prepend(resDir)); - } - return qml; -} - -#endif // QMLRES_H diff --git a/examples/quick3d/cube/cube.pro b/examples/quick3d/cube/cube.pro index bd458f474..62877c0dd 100644 --- a/examples/quick3d/cube/cube.pro +++ b/examples/quick3d/cube/cube.pro @@ -3,11 +3,11 @@ TARGET = cube_qml CONFIG += qt warn_on SOURCES += main.cpp -HEADERS += qmlres.h +HEADERS += ../qmlres.h QT += declarative -DESTDIR = ../../../bin/$$TARGET +!package:DESTDIR = ../../../bin qmlResources.files = qml symbian { @@ -17,7 +17,23 @@ symbian { qmlResources.path = Contents/Resources QMAKE_BUNDLE_DATA += qmlResources } else { - qmlResources.path = $$OUT_PWD/../../../bin/$$TARGET.qml - INSTALLS += qmlResources + !package { + qmlResources.input = qmlResources.files + qmlResources.output = $$OUT_PWD/../../../bin/resources/examples/$$TARGET/qml + qmlResources.commands = $$QMAKE_COPY_DIR ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + qmlResources.CONFIG += no_link_no_clean + qmlResources.variable_out = POST_TARGETDEPS + QMAKE_EXTRA_COMPILERS += qmlResources + } } } + +# for make install use in packages +distInstalls.files = qml +distInstalls.path = $$[QT_INSTALL_DATA]/quick3d/examples/$$TARGET +INSTALLS += distInstalls + +package { + target.path = $$[QT_INSTALL_BINS] + INSTALLS += target +} diff --git a/examples/quick3d/cube/main.cpp b/examples/quick3d/cube/main.cpp index 28dffe916..b8c32ade6 100644 --- a/examples/quick3d/cube/main.cpp +++ b/examples/quick3d/cube/main.cpp @@ -42,7 +42,7 @@ #include <QtGui/QApplication> #include <QtDeclarative/qdeclarativeview.h> -#include "qmlres.h" +#include "../qmlres.h" int main(int argc, char *argv[]) { diff --git a/examples/quick3d/cube/qmlres.h b/examples/quick3d/cube/qmlres.h deleted file mode 100644 index a027c35e5..000000000 --- a/examples/quick3d/cube/qmlres.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#ifndef QMLRES_H -#define QMLRES_H - -#include <QtCore/qdir.h> - -static inline QString q_get_qmldir(const QString &name) -{ - QString qml = name; - QDir dir = QApplication::applicationDirPath(); - QString resDir = QApplication::applicationName() + QLatin1String("_resources"); - if (dir.path().endsWith(QLatin1String("MacOS"))) - { - // inside an app bundle - get qml resources from there - dir.cdUp(); - dir.cd(QLatin1String("Resources")); - qml = dir.filePath(qml); - } - else if (dir.exists(resDir)) - { - qml = dir.filePath(qml.prepend(resDir)); - } - return qml; -} - -#endif // QMLRES_H diff --git a/examples/quick3d/dirs b/examples/quick3d/dirs index 3c0fc235b..32915235b 100644 --- a/examples/quick3d/dirs +++ b/examples/quick3d/dirs @@ -1,13 +1,13 @@ +./sphere +./textures +./shaders +./forest ./bounce ./cube -./forest +./moon ./lander -./matrix_animation ./monkeygod -./moon -./photopane -./photoroom -./shaders -./sphere ./teapot -./textures +./photoroom +./matrix_animation +./basket diff --git a/examples/quick3d/forest/forest.pro b/examples/quick3d/forest/forest.pro index 579679c37..a13dfecef 100644 --- a/examples/quick3d/forest/forest.pro +++ b/examples/quick3d/forest/forest.pro @@ -3,11 +3,11 @@ TARGET = forest_qml CONFIG += qt warn_on SOURCES += main.cpp -HEADERS += qmlres.h +HEADERS += ../qmlres.h QT += declarative -DESTDIR = ../../../bin/$$TARGET +!package:DESTDIR = ../../../bin qmlResources.files = qml symbian { @@ -17,7 +17,23 @@ symbian { qmlResources.path = Contents/Resources QMAKE_BUNDLE_DATA += qmlResources } else { - qmlResources.path = $$OUT_PWD/../../../bin/$$TARGET.qml - INSTALLS += qmlResources + !package { + qmlResources.input = qmlResources.files + qmlResources.output = $$OUT_PWD/../../../bin/resources/examples/$$TARGET/qml + qmlResources.commands = $$QMAKE_COPY_DIR ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + qmlResources.CONFIG += no_link_no_clean + qmlResources.variable_out = POST_TARGETDEPS + QMAKE_EXTRA_COMPILERS += qmlResources + } } } + +# for make install use in packages +distInstalls.files = qml +distInstalls.path = $$[QT_INSTALL_DATA]/quick3d/examples/$$TARGET +INSTALLS += distInstalls + +package { + target.path = $$[QT_INSTALL_BINS] + INSTALLS += target +} diff --git a/examples/quick3d/forest/main.cpp b/examples/quick3d/forest/main.cpp index 6ca600636..7abf20c24 100644 --- a/examples/quick3d/forest/main.cpp +++ b/examples/quick3d/forest/main.cpp @@ -42,7 +42,7 @@ #include <QtGui/QApplication> #include <QtDeclarative/qdeclarativeview.h> -#include "qmlres.h" +#include "../qmlres.h" int main(int argc, char *argv[]) { diff --git a/examples/quick3d/forest/qmlres.h b/examples/quick3d/forest/qmlres.h deleted file mode 100644 index a027c35e5..000000000 --- a/examples/quick3d/forest/qmlres.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#ifndef QMLRES_H -#define QMLRES_H - -#include <QtCore/qdir.h> - -static inline QString q_get_qmldir(const QString &name) -{ - QString qml = name; - QDir dir = QApplication::applicationDirPath(); - QString resDir = QApplication::applicationName() + QLatin1String("_resources"); - if (dir.path().endsWith(QLatin1String("MacOS"))) - { - // inside an app bundle - get qml resources from there - dir.cdUp(); - dir.cd(QLatin1String("Resources")); - qml = dir.filePath(qml); - } - else if (dir.exists(resDir)) - { - qml = dir.filePath(qml.prepend(resDir)); - } - return qml; -} - -#endif // QMLRES_H diff --git a/examples/quick3d/lander/lander.pro b/examples/quick3d/lander/lander.pro index 2ba573e7f..16f8e39e1 100644 --- a/examples/quick3d/lander/lander.pro +++ b/examples/quick3d/lander/lander.pro @@ -4,11 +4,11 @@ CONFIG += qt warn_on INCLUDEPATH += ../basket SOURCES += main.cpp -HEADERS += qmlres.h +HEADERS += ../qmlres.h QT += declarative -DESTDIR = ../../../bin/$$TARGET +!package:DESTDIR = ../../../bin qmlResources.files = qml symbian { @@ -18,7 +18,23 @@ symbian { qmlResources.path = Contents/Resources QMAKE_BUNDLE_DATA += qmlResources } else { - qmlResources.path = $$OUT_PWD/../../../bin/$$TARGET.qml - INSTALLS += qmlResources + !package { + qmlResources.input = qmlResources.files + qmlResources.output = $$OUT_PWD/../../../bin/resources/examples/$$TARGET/qml + qmlResources.commands = $$QMAKE_COPY_DIR ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + qmlResources.CONFIG += no_link_no_clean + qmlResources.variable_out = POST_TARGETDEPS + QMAKE_EXTRA_COMPILERS += qmlResources + } } } + +# for make install use in packages +distInstalls.files = qml +distInstalls.path = $$[QT_INSTALL_DATA]/quick3d/examples/$$TARGET +INSTALLS += distInstalls + +package { + target.path = $$[QT_INSTALL_BINS] + INSTALLS += target +} diff --git a/examples/quick3d/lander/main.cpp b/examples/quick3d/lander/main.cpp index 43441c644..848e5908e 100644 --- a/examples/quick3d/lander/main.cpp +++ b/examples/quick3d/lander/main.cpp @@ -42,7 +42,7 @@ #include <QtGui/QApplication> #include <QtDeclarative/qdeclarativeview.h> -#include "qmlres.h" +#include "../qmlres.h" int main(int argc, char *argv[]) { diff --git a/examples/quick3d/lander/qmlres.h b/examples/quick3d/lander/qmlres.h deleted file mode 100644 index a027c35e5..000000000 --- a/examples/quick3d/lander/qmlres.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#ifndef QMLRES_H -#define QMLRES_H - -#include <QtCore/qdir.h> - -static inline QString q_get_qmldir(const QString &name) -{ - QString qml = name; - QDir dir = QApplication::applicationDirPath(); - QString resDir = QApplication::applicationName() + QLatin1String("_resources"); - if (dir.path().endsWith(QLatin1String("MacOS"))) - { - // inside an app bundle - get qml resources from there - dir.cdUp(); - dir.cd(QLatin1String("Resources")); - qml = dir.filePath(qml); - } - else if (dir.exists(resDir)) - { - qml = dir.filePath(qml.prepend(resDir)); - } - return qml; -} - -#endif // QMLRES_H diff --git a/examples/quick3d/matrix_animation/main.cpp b/examples/quick3d/matrix_animation/main.cpp index f4e851fd4..54d7df86d 100644 --- a/examples/quick3d/matrix_animation/main.cpp +++ b/examples/quick3d/matrix_animation/main.cpp @@ -42,7 +42,7 @@ #include <QtGui/QApplication> #include <QtDeclarative/qdeclarativeview.h> -#include "qmlres.h" +#include "../qmlres.h" int main(int argc, char *argv[]) { diff --git a/examples/quick3d/matrix_animation/matrix_animation.pro b/examples/quick3d/matrix_animation/matrix_animation.pro index 5d1afa8a9..e6070141d 100644 --- a/examples/quick3d/matrix_animation/matrix_animation.pro +++ b/examples/quick3d/matrix_animation/matrix_animation.pro @@ -5,11 +5,11 @@ CONFIG += qt warn_on INCLUDEPATH += ../basket SOURCES += main.cpp -HEADERS += qmlres.h +HEADERS += ../qmlres.h QT += declarative -DESTDIR = ../../../bin/$$TARGET +!package:DESTDIR = ../../../bin qmlResources.files = qml symbian { @@ -19,7 +19,23 @@ symbian { qmlResources.path = Contents/Resources QMAKE_BUNDLE_DATA += qmlResources } else { - qmlResources.path = $$OUT_PWD/../../../bin/$$TARGET.qml - INSTALLS += qmlResources + !package { + qmlResources.input = qmlResources.files + qmlResources.output = $$OUT_PWD/../../../bin/resources/examples/$$TARGET/qml + qmlResources.commands = $$QMAKE_COPY_DIR ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + qmlResources.CONFIG += no_link_no_clean + qmlResources.variable_out = POST_TARGETDEPS + QMAKE_EXTRA_COMPILERS += qmlResources + } } } + +# for make install use in packages +distInstalls.files = qml +distInstalls.path = $$[QT_INSTALL_DATA]/quick3d/examples/$$TARGET +INSTALLS += distInstalls + +package { + target.path = $$[QT_INSTALL_BINS] + INSTALLS += target +} diff --git a/examples/quick3d/matrix_animation/qmlres.h b/examples/quick3d/matrix_animation/qmlres.h deleted file mode 100644 index a027c35e5..000000000 --- a/examples/quick3d/matrix_animation/qmlres.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#ifndef QMLRES_H -#define QMLRES_H - -#include <QtCore/qdir.h> - -static inline QString q_get_qmldir(const QString &name) -{ - QString qml = name; - QDir dir = QApplication::applicationDirPath(); - QString resDir = QApplication::applicationName() + QLatin1String("_resources"); - if (dir.path().endsWith(QLatin1String("MacOS"))) - { - // inside an app bundle - get qml resources from there - dir.cdUp(); - dir.cd(QLatin1String("Resources")); - qml = dir.filePath(qml); - } - else if (dir.exists(resDir)) - { - qml = dir.filePath(qml.prepend(resDir)); - } - return qml; -} - -#endif // QMLRES_H diff --git a/examples/quick3d/monkeygod/main.cpp b/examples/quick3d/monkeygod/main.cpp index 17a5f10b2..15d0eea02 100644 --- a/examples/quick3d/monkeygod/main.cpp +++ b/examples/quick3d/monkeygod/main.cpp @@ -42,7 +42,7 @@ #include <QtGui/QApplication> #include <QtDeclarative/qdeclarativeview.h> -#include "qmlres.h" +#include "../qmlres.h" int main(int argc, char *argv[]) { diff --git a/examples/quick3d/monkeygod/monkeygod.pro b/examples/quick3d/monkeygod/monkeygod.pro index dc19bada9..59c8946de 100644 --- a/examples/quick3d/monkeygod/monkeygod.pro +++ b/examples/quick3d/monkeygod/monkeygod.pro @@ -5,11 +5,11 @@ CONFIG += qt warn_on INCLUDEPATH += ../basket SOURCES += main.cpp -HEADERS += qmlres.h +HEADERS += ../qmlres.h QT += declarative -DESTDIR = ../../../bin/$$TARGET +!package:DESTDIR = ../../../bin qmlResources.files = qml symbian { @@ -19,7 +19,23 @@ symbian { qmlResources.path = Contents/Resources QMAKE_BUNDLE_DATA += qmlResources } else { - qmlResources.path = $$OUT_PWD/../../../bin/$$TARGET.qml - INSTALLS += qmlResources + !package { + qmlResources.input = qmlResources.files + qmlResources.output = $$OUT_PWD/../../../bin/resources/examples/$$TARGET/qml + qmlResources.commands = $$QMAKE_COPY_DIR ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + qmlResources.CONFIG += no_link_no_clean + qmlResources.variable_out = POST_TARGETDEPS + QMAKE_EXTRA_COMPILERS += qmlResources + } } } + +# for make install use in packages +distInstalls.files = qml +distInstalls.path = $$[QT_INSTALL_DATA]/quick3d/examples/$$TARGET +INSTALLS += distInstalls + +package { + target.path = $$[QT_INSTALL_BINS] + INSTALLS += target +} diff --git a/examples/quick3d/monkeygod/qmlres.h b/examples/quick3d/monkeygod/qmlres.h deleted file mode 100644 index a027c35e5..000000000 --- a/examples/quick3d/monkeygod/qmlres.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#ifndef QMLRES_H -#define QMLRES_H - -#include <QtCore/qdir.h> - -static inline QString q_get_qmldir(const QString &name) -{ - QString qml = name; - QDir dir = QApplication::applicationDirPath(); - QString resDir = QApplication::applicationName() + QLatin1String("_resources"); - if (dir.path().endsWith(QLatin1String("MacOS"))) - { - // inside an app bundle - get qml resources from there - dir.cdUp(); - dir.cd(QLatin1String("Resources")); - qml = dir.filePath(qml); - } - else if (dir.exists(resDir)) - { - qml = dir.filePath(qml.prepend(resDir)); - } - return qml; -} - -#endif // QMLRES_H diff --git a/examples/quick3d/moon/main.cpp b/examples/quick3d/moon/main.cpp index 15191cae1..82c7c1216 100644 --- a/examples/quick3d/moon/main.cpp +++ b/examples/quick3d/moon/main.cpp @@ -42,7 +42,7 @@ #include <QtGui/QApplication> #include <QtDeclarative/qdeclarativeview.h> -#include "qmlres.h" +#include "../qmlres.h" int main(int argc, char *argv[]) { diff --git a/examples/quick3d/moon/moon.pro b/examples/quick3d/moon/moon.pro index 150639f4d..3b5fd27ff 100644 --- a/examples/quick3d/moon/moon.pro +++ b/examples/quick3d/moon/moon.pro @@ -3,11 +3,11 @@ TARGET = moon CONFIG += qt warn_on SOURCES += main.cpp -HEADERS += qmlres.h +HEADERS += ../qmlres.h QT += declarative -DESTDIR = ../../../bin/$$TARGET +!package:DESTDIR = ../../../bin qmlResources.files = qml symbian { @@ -17,7 +17,23 @@ symbian { qmlResources.path = Contents/Resources QMAKE_BUNDLE_DATA += qmlResources } else { - qmlResources.path = $$OUT_PWD/../../../bin/$$TARGET.qml - INSTALLS += qmlResources + !package { + qmlResources.input = qmlResources.files + qmlResources.output = $$OUT_PWD/../../../bin/resources/examples/$$TARGET/qml + qmlResources.commands = $$QMAKE_COPY_DIR ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + qmlResources.CONFIG += no_link_no_clean + qmlResources.variable_out = POST_TARGETDEPS + QMAKE_EXTRA_COMPILERS += qmlResources + } } } + +# for make install use in packages +distInstalls.files = qml +distInstalls.path = $$[QT_INSTALL_DATA]/quick3d/examples/$$TARGET +INSTALLS += distInstalls + +package { + target.path = $$[QT_INSTALL_BINS] + INSTALLS += target +} diff --git a/examples/quick3d/moon/qmlres.h b/examples/quick3d/moon/qmlres.h deleted file mode 100644 index a027c35e5..000000000 --- a/examples/quick3d/moon/qmlres.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#ifndef QMLRES_H -#define QMLRES_H - -#include <QtCore/qdir.h> - -static inline QString q_get_qmldir(const QString &name) -{ - QString qml = name; - QDir dir = QApplication::applicationDirPath(); - QString resDir = QApplication::applicationName() + QLatin1String("_resources"); - if (dir.path().endsWith(QLatin1String("MacOS"))) - { - // inside an app bundle - get qml resources from there - dir.cdUp(); - dir.cd(QLatin1String("Resources")); - qml = dir.filePath(qml); - } - else if (dir.exists(resDir)) - { - qml = dir.filePath(qml.prepend(resDir)); - } - return qml; -} - -#endif // QMLRES_H diff --git a/examples/quick3d/photoroom/main.cpp b/examples/quick3d/photoroom/main.cpp index e2bcd9cae..20f2bc916 100644 --- a/examples/quick3d/photoroom/main.cpp +++ b/examples/quick3d/photoroom/main.cpp @@ -42,7 +42,7 @@ #include <QtGui/QApplication> #include <QtDeclarative/qdeclarativeview.h> -#include "qmlres.h" +#include "../qmlres.h" int main(int argc, char *argv[]) { diff --git a/examples/quick3d/photoroom/photoroom.pro b/examples/quick3d/photoroom/photoroom.pro index 526271ecc..5fe93b5e3 100644 --- a/examples/quick3d/photoroom/photoroom.pro +++ b/examples/quick3d/photoroom/photoroom.pro @@ -3,11 +3,11 @@ TARGET = photoroom CONFIG += qt warn_on SOURCES += main.cpp -HEADERS += qmlres.h +HEADERS += ../qmlres.h QT += declarative -DESTDIR = ../../../bin/$$TARGET +!package:DESTDIR = ../../../bin qmlResources.files = qml symbian { @@ -17,7 +17,23 @@ symbian { qmlResources.path = Contents/Resources QMAKE_BUNDLE_DATA += qmlResources } else { - qmlResources.path = $$OUT_PWD/../../../bin/$$TARGET.qml - INSTALLS += qmlResources + !package { + qmlResources.input = qmlResources.files + qmlResources.output = $$OUT_PWD/../../../bin/resources/examples/$$TARGET/qml + qmlResources.commands = $$QMAKE_COPY_DIR ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + qmlResources.CONFIG += no_link_no_clean + qmlResources.variable_out = POST_TARGETDEPS + QMAKE_EXTRA_COMPILERS += qmlResources + } } } + +# for make install use in packages +distInstalls.files = qml +distInstalls.path = $$[QT_INSTALL_DATA]/quick3d/examples/$$TARGET +INSTALLS += distInstalls + +package { + target.path = $$[QT_INSTALL_BINS] + INSTALLS += target +} diff --git a/examples/quick3d/photoroom/qmlres.h b/examples/quick3d/photoroom/qmlres.h deleted file mode 100644 index a027c35e5..000000000 --- a/examples/quick3d/photoroom/qmlres.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#ifndef QMLRES_H -#define QMLRES_H - -#include <QtCore/qdir.h> - -static inline QString q_get_qmldir(const QString &name) -{ - QString qml = name; - QDir dir = QApplication::applicationDirPath(); - QString resDir = QApplication::applicationName() + QLatin1String("_resources"); - if (dir.path().endsWith(QLatin1String("MacOS"))) - { - // inside an app bundle - get qml resources from there - dir.cdUp(); - dir.cd(QLatin1String("Resources")); - qml = dir.filePath(qml); - } - else if (dir.exists(resDir)) - { - qml = dir.filePath(qml.prepend(resDir)); - } - return qml; -} - -#endif // QMLRES_H diff --git a/examples/quick3d/qmlres.h b/examples/quick3d/qmlres.h new file mode 100644 index 000000000..47470628b --- /dev/null +++ b/examples/quick3d/qmlres.h @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#ifndef QMLRES_H +#define QMLRES_H + +#include <QtCore/qdir.h> +#include <QtCore/qcoreapplication.h> + +#include <QtCore/qdebug.h> + +/*! + \internal + Returns a string with the path to qml resources, including qml sources, + 3D assets and textures. The path depends on the platform, and (for + some platforms) whether it was installed from a package or is being run + in a development setting. +*/ +static QString q_get_qmldir(const QString &name) +{ + QString qml = name; + // try for a Linux package install first + QDir pkgdir(QLatin1String("/usr/share/qt4/quick3d/examples")); + if (pkgdir.cd(QCoreApplication::applicationName()) + && pkgdir.exists()) + { + qml = pkgdir.filePath(qml); + } + else + { + // failing that try Mac (pkg & dev) next + QDir dir(QCoreApplication::applicationDirPath()); + if (dir.path().endsWith(QLatin1String("MacOS"))) + { + if (dir.cdUp() && dir.cd(QLatin1String("Resources")) + && dir.exists()) + { + qml = dir.filePath(qml); + } + else + { + qWarning("Expected app bundle with QML resources!"); + } + } + else + { + // for Windows (pkg & dev), and for Linux dev expect to find it + // in a "resources" directory next to the binary + if (dir.cd(QLatin1String("resources")) && dir.exists()) + { + QString app = QCoreApplication::applicationFilePath(); + app = app.section(QDir::separator(), -1); + if (dir.cd(QLatin1String("examples")) && dir.cd(app) && dir.exists()) + { + qml = dir.filePath(qml); + } + else + { + QString msg = QLatin1String("examples"); + msg += QDir::separator(); + msg += QCoreApplication::applicationName(); + qWarning("Expected %s directry with qml resources!", qPrintable(msg)); + } + } + } + } + return qml; +} + +#endif // QMLRES_H diff --git a/examples/quick3d/shaders/main.cpp b/examples/quick3d/shaders/main.cpp index c22b06f6e..49a1aab0e 100644 --- a/examples/quick3d/shaders/main.cpp +++ b/examples/quick3d/shaders/main.cpp @@ -42,7 +42,7 @@ #include <QtGui/QApplication> #include <QtDeclarative/qdeclarativeview.h> -#include "qmlres.h" +#include "../qmlres.h" int main(int argc, char *argv[]) { diff --git a/examples/quick3d/shaders/qmlres.h b/examples/quick3d/shaders/qmlres.h deleted file mode 100644 index a027c35e5..000000000 --- a/examples/quick3d/shaders/qmlres.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#ifndef QMLRES_H -#define QMLRES_H - -#include <QtCore/qdir.h> - -static inline QString q_get_qmldir(const QString &name) -{ - QString qml = name; - QDir dir = QApplication::applicationDirPath(); - QString resDir = QApplication::applicationName() + QLatin1String("_resources"); - if (dir.path().endsWith(QLatin1String("MacOS"))) - { - // inside an app bundle - get qml resources from there - dir.cdUp(); - dir.cd(QLatin1String("Resources")); - qml = dir.filePath(qml); - } - else if (dir.exists(resDir)) - { - qml = dir.filePath(qml.prepend(resDir)); - } - return qml; -} - -#endif // QMLRES_H diff --git a/examples/quick3d/shaders/shaders.pro b/examples/quick3d/shaders/shaders.pro index b563b3d30..3d5348eec 100644 --- a/examples/quick3d/shaders/shaders.pro +++ b/examples/quick3d/shaders/shaders.pro @@ -3,11 +3,11 @@ TARGET = shaders CONFIG += qt warn_on SOURCES += main.cpp -HEADERS += qmlres.h +HEADERS += ../qmlres.h QT += declarative -DESTDIR = ../../../bin/$$TARGET +!package:DESTDIR = ../../../bin qmlResources.files = qml symbian { @@ -17,7 +17,23 @@ symbian { qmlResources.path = Contents/Resources QMAKE_BUNDLE_DATA += qmlResources } else { - qmlResources.path = $$OUT_PWD/../../../bin/$$TARGET.qml - INSTALLS += qmlResources + !package { + qmlResources.input = qmlResources.files + qmlResources.output = $$OUT_PWD/../../../bin/resources/examples/$$TARGET/qml + qmlResources.commands = $$QMAKE_COPY_DIR ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + qmlResources.CONFIG += no_link_no_clean + qmlResources.variable_out = POST_TARGETDEPS + QMAKE_EXTRA_COMPILERS += qmlResources + } } } + +# for make install use in packages +distInstalls.files = qml +distInstalls.path = $$[QT_INSTALL_DATA]/quick3d/examples/$$TARGET +INSTALLS += distInstalls + +package { + target.path = $$[QT_INSTALL_BINS] + INSTALLS += target +} diff --git a/examples/quick3d/sphere/main.cpp b/examples/quick3d/sphere/main.cpp index 0a08a034d..e64e3d738 100644 --- a/examples/quick3d/sphere/main.cpp +++ b/examples/quick3d/sphere/main.cpp @@ -42,7 +42,7 @@ #include <QtGui/QApplication> #include <QtDeclarative/qdeclarativeview.h> -#include "qmlres.h" +#include "../qmlres.h" int main(int argc, char *argv[]) { diff --git a/examples/quick3d/sphere/qmlres.h b/examples/quick3d/sphere/qmlres.h deleted file mode 100644 index a027c35e5..000000000 --- a/examples/quick3d/sphere/qmlres.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#ifndef QMLRES_H -#define QMLRES_H - -#include <QtCore/qdir.h> - -static inline QString q_get_qmldir(const QString &name) -{ - QString qml = name; - QDir dir = QApplication::applicationDirPath(); - QString resDir = QApplication::applicationName() + QLatin1String("_resources"); - if (dir.path().endsWith(QLatin1String("MacOS"))) - { - // inside an app bundle - get qml resources from there - dir.cdUp(); - dir.cd(QLatin1String("Resources")); - qml = dir.filePath(qml); - } - else if (dir.exists(resDir)) - { - qml = dir.filePath(qml.prepend(resDir)); - } - return qml; -} - -#endif // QMLRES_H diff --git a/examples/quick3d/sphere/sphere.pro b/examples/quick3d/sphere/sphere.pro index b0b450c7d..7fb6e0d5b 100644 --- a/examples/quick3d/sphere/sphere.pro +++ b/examples/quick3d/sphere/sphere.pro @@ -3,11 +3,11 @@ TARGET = sphere CONFIG += qt warn_on SOURCES += main.cpp -HEADERS += qmlres.h +HEADERS += ../qmlres.h QT += declarative -DESTDIR = ../../../bin/$$TARGET +!package:DESTDIR = ../../../bin qmlResources.files = qml symbian { @@ -17,7 +17,23 @@ symbian { qmlResources.path = Contents/Resources QMAKE_BUNDLE_DATA += qmlResources } else { - qmlResources.path = $$OUT_PWD/../../../bin/$$TARGET.qml - INSTALLS += qmlResources + !package { + qmlResources.input = qmlResources.files + qmlResources.output = $$OUT_PWD/../../../bin/resources/examples/$$TARGET/qml + qmlResources.commands = $$QMAKE_COPY_DIR ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + qmlResources.CONFIG += no_link_no_clean + qmlResources.variable_out = POST_TARGETDEPS + QMAKE_EXTRA_COMPILERS += qmlResources + } } } + +# for make install use in packages +distInstalls.files = qml +distInstalls.path = $$[QT_INSTALL_DATA]/quick3d/examples/$$TARGET +INSTALLS += distInstalls + +package { + target.path = $$[QT_INSTALL_BINS] + INSTALLS += target +} diff --git a/examples/quick3d/teapot/main.cpp b/examples/quick3d/teapot/main.cpp index 24bfc1d26..eb03f4194 100644 --- a/examples/quick3d/teapot/main.cpp +++ b/examples/quick3d/teapot/main.cpp @@ -42,7 +42,7 @@ #include <QtGui/QApplication> #include <QtDeclarative/qdeclarativeview.h> -#include "qmlres.h" +#include "../qmlres.h" int main(int argc, char *argv[]) { diff --git a/examples/quick3d/teapot/qmlres.h b/examples/quick3d/teapot/qmlres.h deleted file mode 100644 index a027c35e5..000000000 --- a/examples/quick3d/teapot/qmlres.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#ifndef QMLRES_H -#define QMLRES_H - -#include <QtCore/qdir.h> - -static inline QString q_get_qmldir(const QString &name) -{ - QString qml = name; - QDir dir = QApplication::applicationDirPath(); - QString resDir = QApplication::applicationName() + QLatin1String("_resources"); - if (dir.path().endsWith(QLatin1String("MacOS"))) - { - // inside an app bundle - get qml resources from there - dir.cdUp(); - dir.cd(QLatin1String("Resources")); - qml = dir.filePath(qml); - } - else if (dir.exists(resDir)) - { - qml = dir.filePath(qml.prepend(resDir)); - } - return qml; -} - -#endif // QMLRES_H diff --git a/examples/quick3d/teapot/teapot.pro b/examples/quick3d/teapot/teapot.pro index 758cd1509..37d435b87 100644 --- a/examples/quick3d/teapot/teapot.pro +++ b/examples/quick3d/teapot/teapot.pro @@ -3,11 +3,11 @@ TARGET = teapot CONFIG += qt warn_on SOURCES += main.cpp -HEADERS += qmlres.h +HEADERS += ../qmlres.h QT += declarative -DESTDIR = ../../../bin/$$TARGET +!package:DESTDIR = ../../../bin qmlResources.files = qml symbian { @@ -17,7 +17,23 @@ symbian { qmlResources.path = Contents/Resources QMAKE_BUNDLE_DATA += qmlResources } else { - qmlResources.path = $$OUT_PWD/../../../bin/$$TARGET.qml - INSTALLS += qmlResources + !package { + qmlResources.input = qmlResources.files + qmlResources.output = $$OUT_PWD/../../../bin/resources/examples/$$TARGET/qml + qmlResources.commands = $$QMAKE_COPY_DIR ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + qmlResources.CONFIG += no_link_no_clean + qmlResources.variable_out = POST_TARGETDEPS + QMAKE_EXTRA_COMPILERS += qmlResources + } } } + +# for make install use in packages +distInstalls.files = qml +distInstalls.path = $$[QT_INSTALL_DATA]/quick3d/examples/$$TARGET +INSTALLS += distInstalls + +package { + target.path = $$[QT_INSTALL_BINS] + INSTALLS += target +} diff --git a/examples/quick3d/textures/qmlres.h b/examples/quick3d/textures/qmlres.h deleted file mode 100644 index a027c35e5..000000000 --- a/examples/quick3d/textures/qmlres.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#ifndef QMLRES_H -#define QMLRES_H - -#include <QtCore/qdir.h> - -static inline QString q_get_qmldir(const QString &name) -{ - QString qml = name; - QDir dir = QApplication::applicationDirPath(); - QString resDir = QApplication::applicationName() + QLatin1String("_resources"); - if (dir.path().endsWith(QLatin1String("MacOS"))) - { - // inside an app bundle - get qml resources from there - dir.cdUp(); - dir.cd(QLatin1String("Resources")); - qml = dir.filePath(qml); - } - else if (dir.exists(resDir)) - { - qml = dir.filePath(qml.prepend(resDir)); - } - return qml; -} - -#endif // QMLRES_H diff --git a/quick3d.pro b/quick3d.pro index c3de84904..aad3aeb40 100644 --- a/quick3d.pro +++ b/quick3d.pro @@ -1,7 +1,7 @@ TEMPLATE = subdirs SUBDIRS += src !gcov: SUBDIRS += util examples demos -SUBDIRS += tests +!package: SUBDIRS += tests CONFIG += ordered include(doc/doc.pri) @@ -20,23 +20,29 @@ contains(QT_CONFIG, opengles1) { # Install qt3d.prf into the Qt mkspecs so that "CONFIG += qt3d" # can be used in applications to build against Qt3D. -symbian|win32 { - Qt3DFile=$$PWD\\features\\qt3d.prf - Qt3DFile=$$replace(Qt3DFile,/,\\) - featuresDir=$$[QT_INSTALL_DATA]\\mkspecs\\features - featuresDir=$$replace(featuresDir,/,\\) - system(copy "$$Qt3DFile $$featuresDir") - - Qt3DQuickFile=$$PWD\\features\\qt3dquick.prf - Qt3DQuickFile=$$replace(Qt3DQuickFile,/,\\) - system(copy "$$Qt3DQuickFile $$featuresDir") +package { + distInstalls.files = features/qt3d.prf features/qt3dquick.prf + distInstalls.path = $$[QT_INSTALL_DATA]/mkspecs/features + INSTALLS += distInstalls } else { - Qt3DFile=$$PWD/features/qt3d.prf - featuresDir=$$[QT_INSTALL_DATA]/mkspecs/features - system(cp "$$Qt3DFile $$featuresDir") + symbian|win32 { + Qt3DFile=$$PWD\\features\\qt3d.prf + Qt3DFile=$$replace(Qt3DFile,/,\\) + featuresDir=$$[QT_INSTALL_DATA]\\mkspecs\\features + featuresDir=$$replace(featuresDir,/,\\) + system(copy "$$Qt3DFile $$featuresDir") + + Qt3DQuickFile=$$PWD\\features\\qt3dquick.prf + Qt3DQuickFile=$$replace(Qt3DQuickFile,/,\\) + system(copy "$$Qt3DQuickFile $$featuresDir") + } else { + Qt3DFile=$$PWD/features/qt3d.prf + featuresDir=$$[QT_INSTALL_DATA]/mkspecs/features + system(cp "$$Qt3DFile $$featuresDir") - Qt3DQuickFile=$$PWD/features/qt3dquick.prf - system(cp "$$Qt3DQuickFile $$featuresDir") + Qt3DQuickFile=$$PWD/features/qt3dquick.prf + system(cp "$$Qt3DQuickFile $$featuresDir") + } } symbian { diff --git a/src/imports/shapes/shapes.pro b/src/imports/shapes/shapes.pro index 13fd24f78..cdf451edb 100644 --- a/src/imports/shapes/shapes.pro +++ b/src/imports/shapes/shapes.pro @@ -2,6 +2,13 @@ TEMPLATE = lib TARGET = qshapesqmlplugin CONFIG += qt plugin qt3dquick +package { + LIBS += -L../../quick3d -L../../threed + INCLUDEPATH += ../../../include +} else { + CONFIG += qt3dquick +} + win32 { CONFIG(debug, debug|release) { TARGET = $$member(TARGET, 0)d diff --git a/src/imports/threed/threed.pro b/src/imports/threed/threed.pro index 7fd9883a4..c7484f487 100644 --- a/src/imports/threed/threed.pro +++ b/src/imports/threed/threed.pro @@ -1,6 +1,13 @@ TEMPLATE = lib TARGET = qthreedqmlplugin -CONFIG += qt plugin qt3d qt3dquick +CONFIG += qt plugin + +package { + LIBS += -L../../threed -L../../quick3d + INCLUDEPATH += ../../../include +} else { + CONFIG += qt3d qt3dquick +} win32 { CONFIG(debug, debug|release) { diff --git a/src/plugins/imageformats/tga/tga.pro b/src/plugins/imageformats/tga/tga.pro index 209756e23..ce0437383 100644 --- a/src/plugins/imageformats/tga/tga.pro +++ b/src/plugins/imageformats/tga/tga.pro @@ -5,6 +5,5 @@ HEADERS += qtgahandler.h \ SOURCES += main.cpp \ qtgahandler.cpp \ qtgafile.cpp -QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/imageformats target.path += $$[QT_INSTALL_PLUGINS]/imageformats INSTALLS += target diff --git a/src/plugins/sceneformats/3ds/3ds.pro b/src/plugins/sceneformats/3ds/3ds.pro index 8cd4338dd..d1f77c76d 100644 --- a/src/plugins/sceneformats/3ds/3ds.pro +++ b/src/plugins/sceneformats/3ds/3ds.pro @@ -9,7 +9,14 @@ SOURCES += main.cpp \ qgl3dsscene.cpp \ qgl3dsscenehandler.cpp \ qgl3dsmesh.cpp -CONFIG += qt3d + +package { + LIBS += -L../../../threed + INCLUDEPATH += ../../../../include +} else { + CONFIG += qt3d +} + system_3ds { !isEmpty(QMAKE_INCDIR_3DS):INCLUDEPATH += $$QMAKE_INCDIR_3DS !isEmpty(QMAKE_LIBDIR_3DS):LIBS += -L$$QMAKE_LIBDIR_3DS @@ -23,6 +30,5 @@ system_3ds { include(../../../../3rdparty/lib3ds/lib3ds.pri) } -QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/sceneformats target.path += $$[QT_INSTALL_PLUGINS]/sceneformats INSTALLS += target diff --git a/src/plugins/sceneformats/assimp/assimp.pro b/src/plugins/sceneformats/assimp/assimp.pro index 43b74363e..bd777dd79 100644 --- a/src/plugins/sceneformats/assimp/assimp.pro +++ b/src/plugins/sceneformats/assimp/assimp.pro @@ -13,7 +13,14 @@ SOURCES += main.cpp \ qaimesh.cpp \ ailoaderiostream.cpp \ ailoaderiosystem.cpp -CONFIG += qt3d + +package { + LIBS += -L../../../threed + INCLUDEPATH += ../../../../include +} else { + CONFIG += qt3d +} + system_ai { !isEmpty(QMAKE_INCDIR_AI):INCLUDEPATH += $$QMAKE_INCDIR_AI !isEmpty(QMAKE_LIBDIR_AI):LIBS += -L$$QMAKE_LIBDIR_AI @@ -27,6 +34,5 @@ system_ai { include(../../../../3rdparty/assimp/assimp.pri) } -QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/sceneformats target.path += $$[QT_INSTALL_PLUGINS]/sceneformats INSTALLS += target diff --git a/src/plugins/sceneformats/bezier/bezier.pro b/src/plugins/sceneformats/bezier/bezier.pro index bed100239..19e4ba83d 100644 --- a/src/plugins/sceneformats/bezier/bezier.pro +++ b/src/plugins/sceneformats/bezier/bezier.pro @@ -6,7 +6,13 @@ HEADERS += qglbezierscene.h \ SOURCES += main.cpp \ qglbezierscene.cpp \ qglbezierscenehandler.cpp -CONFIG += qt3d -QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/sceneformats + +package { + LIBS += -L../../../threed + INCLUDEPATH += ../../../../include +} else { + CONFIG += qt3d +} + target.path += $$[QT_INSTALL_PLUGINS]/sceneformats INSTALLS += target diff --git a/src/plugins/sceneformats/obj/obj.pro b/src/plugins/sceneformats/obj/obj.pro index 0eaa76e09..8033b3070 100644 --- a/src/plugins/sceneformats/obj/obj.pro +++ b/src/plugins/sceneformats/obj/obj.pro @@ -6,7 +6,13 @@ HEADERS += qglobjscene.h \ SOURCES += main.cpp \ qglobjscene.cpp \ qglobjscenehandler.cpp -CONFIG += qt3d -QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/sceneformats + +package { + LIBS += -L../../../threed + INCLUDEPATH += ../../../../include +} else { + CONFIG += qt3d +} + target.path += $$[QT_INSTALL_PLUGINS]/sceneformats INSTALLS += target diff --git a/src/quick3d/quick3d.pro b/src/quick3d/quick3d.pro index 4048e97ec..f5b1baff0 100644 --- a/src/quick3d/quick3d.pro +++ b/src/quick3d/quick3d.pro @@ -7,9 +7,19 @@ gcov { } else { CONFIG += dll warn_on } -CONFIG += qt3d + QT += declarative -DESTDIR = $$[QT_INSTALL_LIBS] + +package { + target.path = $$[QT_INSTALL_LIBS] + INSTALLS += target + LIBS += -L$$PWD/../threed + INCLUDEPATH += ../../include + QT += opengl network +} else { + CONFIG += qt3d + DESTDIR = $$[QT_INSTALL_LIBS] +} win32 { DLLDESTDIR = ../../bin @@ -48,6 +58,12 @@ for(hdr, PUBLIC_HEADERS) { INSTALL_HEADERS += $$found_vdir/$$hdr } +package { + distInstalls.files = $$PUBLIC_HEADERS + distInstalls.path = $$[QT_INSTALL_HEADERS]/Qt3DQuick + INSTALLS += distInstalls +} + # If Qt has been configured to build frameworks, then the build witll put # the Qt3DQuick library into a framework bundle, so put the headers in the bundle # as well. Other OS's, or mac without frameworks, install the headers into @@ -61,7 +77,11 @@ macx:CONFIG(qt_framework, qt_framework|qt_no_framework) { QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS } else { exportHeaders.input = PUBLIC_HEADERS - exportHeaders.output = $$[QT_INSTALL_HEADERS]/Qt3DQuick/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT} + package { + exportHeaders.output = ../../include/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT} + } else { + exportHeaders.output = $$[QT_INSTALL_HEADERS]/Qt3DQuick/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT} + } exportHeaders.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} exportHeaders.CONFIG += no_link_no_clean exportHeaders.variable_out = PRE_TARGETDEPS diff --git a/src/threed/threed.pro b/src/threed/threed.pro index e221d65b0..9333eb4f1 100644 --- a/src/threed/threed.pro +++ b/src/threed/threed.pro @@ -9,7 +9,13 @@ gcov { } QT += opengl \ network -DESTDIR = $$[QT_INSTALL_LIBS] + +package { + target.path = $$[QT_INSTALL_LIBS] + INSTALLS += target +} else { + DESTDIR = $$[QT_INSTALL_LIBS] +} win32 { DLLDESTDIR = ../../bin @@ -48,8 +54,11 @@ for(hdr, PUBLIC_HEADERS) { INSTALL_HEADERS += $$found_vdir/$$hdr } - -# -install_name /Users/sarasmit/build/qt/qt-qml/lib/QtOpenGL.framework/Versions/4/QtOpenGL +package { + distInstalls.files = $$PUBLIC_HEADERS + distInstalls.path = $$[QT_INSTALL_HEADERS]/Qt3D + INSTALLS += distInstalls +} # If Qt has been configured to build frameworks, then the build will put # the Qt3D library into a framework bundle, so put the headers in the bundle @@ -64,7 +73,11 @@ macx:CONFIG(qt_framework, qt_framework|qt_no_framework) { QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS } else { exportHeaders.input = PUBLIC_HEADERS - exportHeaders.output = $$[QT_INSTALL_HEADERS]/Qt3D/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT} + package { + exportHeaders.output = ../../include/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT} + } else { + exportHeaders.output = $$[QT_INSTALL_HEADERS]/Qt3D/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT} + } exportHeaders.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} exportHeaders.CONFIG += no_link_no_clean exportHeaders.variable_out = PRE_TARGETDEPS diff --git a/util/meshcvt/meshcvt.pro b/util/meshcvt/meshcvt.pro index 53f336af5..b49ba1422 100644 --- a/util/meshcvt/meshcvt.pro +++ b/util/meshcvt/meshcvt.pro @@ -1,6 +1,11 @@ TARGET = meshcvt -CONFIG += qt3d +package { + LIBS += -L../../src/threed -lQt3D + INCLUDEPATH += ../../include +} else { + CONFIG += qt3d +} SOURCES += \ meshcvt.cpp \ diff --git a/util/qglinfo/qglinfo.pro b/util/qglinfo/qglinfo.pro index 5534df7a3..9f3c4f865 100644 --- a/util/qglinfo/qglinfo.pro +++ b/util/qglinfo/qglinfo.pro @@ -4,7 +4,15 @@ SOURCES += main.cpp \ qglinfo.cpp \ aboutdialog.cpp \ fpswidget.cpp -DESTDIR = ../../bin + +package { + LIBS += -L../../src/threed -lQt3D + INCLUDEPATH += ../../include +} else { + CONFIG += qt3d + DESTDIR = ../../bin +} + CONFIG += qt3d warn_on FORMS += qglinfowindow.ui \ aboutdialog.ui @@ -15,3 +23,8 @@ HEADERS += qglinfowindow.h \ RESOURCES += qglinfo.qrc !contains(QT_CONFIG, egl):DEFINES += QT_NO_EGL + +package { + target.path = $$[QT_INSTALL_BINS] + INSTALLS += target +} |