diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2019-01-18 16:02:43 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2019-02-12 09:12:39 +0000 |
commit | c4e60ed8283aa7a86e13c09113e7fec6bf41cc42 (patch) | |
tree | 6cefbf3ece17e255c3962e69573abc88bef060ef /tests/auto/blackbox/tst_blackboxqt.cpp | |
parent | 17058d1fc537e40e7dda9d6e48ccfb24ea1220f7 (diff) | |
download | qbs-c4e60ed8283aa7a86e13c09113e7fec6bf41cc42.tar.gz |
Detect Qt via a module provider
Creation of qbs modules for Qt is now done on demand during project
resolving. The qmake executable(s) are looked up via PATH or taken from
the Qt.qmakeFilePaths provider property. As a result, Qt projects can
now be built without a profile.
The qtprofilesetup library is gone; its code is now in the module
provider. I kept the C++ -> JavaScript conversion as straightforward as
possible and mostly resisted the temptation to "optimize".
The setup-qt tool still exists and mainly sets Qt.qmakeFilePaths.
[ChangeLog] It is no longer required to call setup-qt before building Qt
projects.
Change-Id: I5b7e4711ec47b996911c499f29d8129d90e4731e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests/auto/blackbox/tst_blackboxqt.cpp')
-rw-r--r-- | tests/auto/blackbox/tst_blackboxqt.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/tests/auto/blackbox/tst_blackboxqt.cpp b/tests/auto/blackbox/tst_blackboxqt.cpp index 128c61133..4428ddb1d 100644 --- a/tests/auto/blackbox/tst_blackboxqt.cpp +++ b/tests/auto/blackbox/tst_blackboxqt.cpp @@ -50,15 +50,12 @@ void TestBlackboxQt::validateTestProfile() if (profileName() != "none" && !s->profiles().contains(profileName())) QFAIL(QByteArray("The build profile '" + profileName().toLocal8Bit() + "' could not be found. Please set it up on your machine.")); - - const QStringList searchPaths - = qbs::Preferences(s.get(), profileName()).searchPaths( - QDir::cleanPath(QCoreApplication::applicationDirPath())); - for (const auto &searchPath : searchPaths) { - if (QFileInfo(searchPath + "/modules/Qt").isDir()) - return; - } - + const QStringList qmakeFilePaths = Profile(profileName(), s.get()) + .value("moduleProviders.Qt.qmakeFilePaths").toStringList(); + if (!qmakeFilePaths.empty()) + return; + if (!findExecutable(QStringList{"qmake"}).isEmpty()) + return; QSKIP(QByteArray("The build profile '" + profileName().toLocal8Bit() + "' is not a valid Qt profile and Qt was not found " "in the global search paths.")); |