diff options
author | Oswald Buddenhagen <[email protected]> | 2016-11-18 18:17:49 +0100 |
---|---|---|
committer | Simon Hausmann <[email protected]> | 2016-12-08 12:40:53 +0000 |
commit | e2978d6097be2313e49c57ec14618033cbfa7414 (patch) | |
tree | b9ccc2e78f1869ed0d94c6569649c7de1488719b /tools/configure/tools.cpp | |
parent | f882d2f443a8950a2f784fa91b3ff10a645577f7 (diff) |
move license check to qmake-based configure system
this also removes the need for passing pre-processed options via
configure.cfg, so get rid of that.
a somewhat unfortunate side effect is that the android-style-assets
feature had to move back to the top level, as the licensing options
depend on it.
Started-by: Lars Knoll <[email protected]>
Change-Id: Id4d1e0ba18b3e3104400293b8f0c7f2f65e68dea
Reviewed-by: Lars Knoll <[email protected]>
Diffstat (limited to 'tools/configure/tools.cpp')
-rw-r--r-- | tools/configure/tools.cpp | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/tools/configure/tools.cpp b/tools/configure/tools.cpp deleted file mode 100644 index 5ba71259754..00000000000 --- a/tools/configure/tools.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "tools.h" -#include "environment.h" - -#include <qdir.h> -#include <qfile.h> -#include <qbytearray.h> -#include <qstringlist.h> - -#include <iostream> - -std::ostream &operator<<(std::ostream &s, const QString &val); -using namespace std; - -void Tools::checkLicense(QMap<QString,QString> &dictionary, - const QString &sourcePath, const QString &buildPath) -{ - dictionary["LICHECK"] = "licheck.exe"; - - const QString licenseChecker = - QDir::toNativeSeparators(sourcePath + "/bin/licheck.exe"); - - if (QFile::exists(licenseChecker)) { - const QString qMakeSpec = - QDir::toNativeSeparators(dictionary.value("QMAKESPEC")); - const QString xQMakeSpec = - QDir::toNativeSeparators(dictionary.value("XQMAKESPEC")); - - QString command = QString("%1 %2 %3 %4 %5 %6") - .arg(licenseChecker, - dictionary.value("LICENSE_CONFIRMED", "no"), - QDir::toNativeSeparators(sourcePath), - QDir::toNativeSeparators(buildPath), - qMakeSpec, xQMakeSpec); - - int returnValue = 0; - QString licheckOutput = Environment::execute(command, &returnValue); - - if (returnValue) { - dictionary["DONE"] = "error"; - } else { - foreach (const QString &var, licheckOutput.split('\n')) - dictionary[var.section('=', 0, 0).toUpper()] = var.section('=', 1, 1); - dictionary["LICENSE_CONFIRMED"] = "yes"; - } - } else { - cout << endl << "Error: Could not find licheck.exe" << endl - << "Try re-installing." << endl << endl; - dictionary["DONE"] = "error"; - } -} - |