summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-10-15 13:23:13 -0700
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-19 15:25:54 +0100
commitdf3631045c35aaed0b9de4ae5e643c8019972d13 (patch)
tree9e4c1bc3489d7e88ccc164f6d6c76142bcad483e /src/corelib/global
parent36270e45058b84c2fc3cb9683278983eedea3a1b (diff)
Add a new location for QML 2.x imports
This commits adds a -qmldir configuration option for the configures to allow the user to change the default location (it defaults to $archdatadir/qml). It adds a QLibraryInfo::Qml2ImportsPath value for QLibraryInfo::location, a qmake property of QT_INSTALL_QML and a qt.conf configure location entry "Qml2Imports". At the same time, it makes the qmake .prf files dealing with QML plugins be the QML 2 version. Those files are new in Qt 5, so we have the option to choose which version we want to use. Discussed-on: http://lists.qt-project.org/pipermail/development/2012-October/007136.html Change-Id: I8c1c53e8685a5934ed0a9a42ba5663297b81a677 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qlibraryinfo.cpp13
-rw-r--r--src/corelib/global/qlibraryinfo.h2
2 files changed, 14 insertions, 1 deletions
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index 13d3a879c7..a756577311 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -257,6 +257,15 @@ QLibraryInfo::isDebugBuild()
#endif // QT_BOOTSTRAPPED
+/*
+ * To add a new entry in QLibrary::LibraryLocation, add it to the enum above the bootstrapped values and:
+ * - add its relative path in the qtConfEntries[] array below
+ * (the key is what appears in a qt.conf file)
+ * - add a property name in qmake/property.cpp propList[] array
+ * (it's used with qmake -query)
+ * - add to qt_config.prf, qt_module.prf, qt_module_fwdpri.prf
+ */
+
static const struct {
char key[14], value[13];
} qtConfEntries[] = {
@@ -267,6 +276,7 @@ static const struct {
{ "Binaries", "bin" },
{ "Plugins", "plugins" }, // should be ${ArchData}/plugins
{ "Imports", "imports" }, // should be ${ArchData}/imports
+ { "Qml2Imports", "qml" }, // should be ${ArchData}/qml
{ "ArchData", "." },
{ "Data", "." },
{ "Translations", "translations" }, // should be ${Data}/translations
@@ -444,7 +454,8 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
\value LibrariesPath The location of installed libraries.
\value BinariesPath The location of installed Qt binaries (tools and applications).
\value PluginsPath The location of installed Qt plugins.
- \value ImportsPath The location of installed QML extensions to import.
+ \value ImportsPath The location of installed QML extensions to import (QML 1.x).
+ \value Qml2ImportsPath The location of installed QML extensions to import (QML 2.x).
\value ArchDataPath The location of general architecture-dependent Qt data.
\value DataPath The location of general architecture-independent Qt data.
\value TranslationsPath The location of translation information for Qt strings.
diff --git a/src/corelib/global/qlibraryinfo.h b/src/corelib/global/qlibraryinfo.h
index 7f035194ef..5d6e42965f 100644
--- a/src/corelib/global/qlibraryinfo.h
+++ b/src/corelib/global/qlibraryinfo.h
@@ -70,12 +70,14 @@ public:
BinariesPath,
PluginsPath,
ImportsPath,
+ Qml2ImportsPath,
ArchDataPath,
DataPath,
TranslationsPath,
ExamplesPath,
TestsPath,
// Insert new values above this line
+ // Please read the comments in qlibraryinfo.cpp before adding
#ifdef QT_BOOTSTRAPPED
// These are not subject to binary compatibility constraints
SysrootPath,