1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
10 ** GNU Lesser General Public License Usage
12 ** This file may be used under the terms of the GNU Lesser General Public
13 ** License version 2.1 as published by the Free Software Foundation and
14 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
15 ** Please review the following information to ensure the GNU Lesser General
16 ** Public License version 2.1 requirements will be met:
17 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
19 ** In addition, as a special exception, Nokia gives you certain additional
20 ** rights. These rights are described in the Nokia Qt LGPL Exception
21 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
25 ** Alternatively, this file may be used in accordance with the terms and
26 ** conditions contained in a signed written agreement between you and Nokia.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
31 **************************************************************************/
33 #ifndef BUILDABLEHELPERLIBRARY_H
34 #define BUILDABLEHELPERLIBRARY_H
36 #include "utils_global.h"
38 #include <QtCore/QString>
40 QT_FORWARD_DECLARE_CLASS(QFileInfo)
46 class QTCREATOR_UTILS_EXPORT BuildableHelperLibrary
49 // returns the full path to the first qmake, qmake-qt4, qmake4 that has
50 // at least version 2.0.0 and thus is a qt4 qmake
51 static QString findSystemQt(const Utils::Environment &env);
52 // return true if the qmake at qmakePath is qt4 (used by QtVersion)
53 static QString qtVersionForQMake(const QString &qmakePath);
54 static bool checkMinimumQtVersion(const QString &qtversionString, int majorVersion, int minorVersion, int patchVersion);
55 // returns something like qmake4, qmake, qmake-qt4 or whatever distributions have chosen (used by QtVersion)
56 static QStringList possibleQMakeCommands();
58 static QString qtInstallHeadersDir(const QString &qmakePath);
59 static QString qtInstallDataDir(const QString &qmakePath);
61 static QString byInstallDataHelper(const QString &sourcePath,
62 const QStringList &sourceFileNames,
63 const QStringList &installDirectories,
64 const QStringList &validBinaryFilenames);
66 static bool copyFiles(const QString &sourcePath, const QStringList &files,
67 const QString &targetDirectory, QString *errorMessage);
69 static bool buildHelper(const QString &helperName, const QString &proFilename,
70 const QString &directory, const QString &makeCommand,
71 const QString &qmakeCommand, const QString &mkspec,
72 const Utils::Environment &env, const QString &targetMode,
73 const QStringList &qmakeArguments, QString *output,
74 QString *errorMessage);
76 static bool getHelperFileInfoFor(const QStringList &validBinaryFilenames,
77 const QString &directory, QFileInfo* info);
82 #endif // BUILDABLEHELPERLIBRARY_H