OSDN Git Service

Update license.
[qt-creator-jp/qt-creator-jp.git] / src / libs / utils / buildablehelperlibrary.h
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
6 **
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
8 **
9 **
10 ** GNU Lesser General Public License Usage
11 **
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.
18 **
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.
22 **
23 ** Other Usage
24 **
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.
27 **
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
30 **
31 **************************************************************************/
32
33 #ifndef BUILDABLEHELPERLIBRARY_H
34 #define BUILDABLEHELPERLIBRARY_H
35
36 #include "utils_global.h"
37
38 #include <QtCore/QString>
39
40 QT_FORWARD_DECLARE_CLASS(QFileInfo)
41
42 namespace Utils {
43
44 class Environment;
45
46 class QTCREATOR_UTILS_EXPORT BuildableHelperLibrary
47 {
48 public:
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();
57
58     static QString qtInstallHeadersDir(const QString &qmakePath);
59     static QString qtInstallDataDir(const QString &qmakePath);
60
61     static QString byInstallDataHelper(const QString &sourcePath,
62                                        const QStringList &sourceFileNames,
63                                        const QStringList &installDirectories,
64                                        const QStringList &validBinaryFilenames);
65
66     static bool copyFiles(const QString &sourcePath, const QStringList &files,
67                           const QString &targetDirectory, QString *errorMessage);
68
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);
75
76     static bool getHelperFileInfoFor(const QStringList &validBinaryFilenames,
77                                      const QString &directory, QFileInfo* info);
78 };
79
80 }
81
82 #endif // BUILDABLEHELPERLIBRARY_H