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 CE_SDK_HANDLER_H
34 #define CE_SDK_HANDLER_H
36 #include <projectexplorer/projectexplorer.h>
38 #include <QtCore/QStringList>
39 #include <QtCore/QDir>
41 #define VCINSTALL_MACRO "$(VCInstallDir)"
42 #define VSINSTALL_MACRO "$(VSInstallDir)"
48 namespace ProjectExplorer {
50 class PROJECTEXPLORER_EXPORT CeSdkInfo
54 inline QString name();
55 inline QString binPath();
56 inline QString includePath();
57 inline QString libPath();
58 void addToEnvironment(Utils::Environment &env);
59 inline bool isValid();
60 inline int majorVersion();
61 inline int minorVersion();
62 inline bool isSupported();
64 friend class CeSdkHandler;
73 inline QString CeSdkInfo::name() { return m_name; }
74 inline QString CeSdkInfo::binPath() { return m_bin; }
75 inline QString CeSdkInfo::includePath() { return m_include; }
76 inline QString CeSdkInfo::libPath() { return m_lib; }
77 inline bool CeSdkInfo::isValid() { return !m_name.isEmpty() && !m_bin.isEmpty() && !m_include.isEmpty() && !m_lib.isEmpty(); }
78 inline int CeSdkInfo::majorVersion() { return m_major; }
79 inline int CeSdkInfo::minorVersion() { return m_minor; }
80 inline bool CeSdkInfo::isSupported() { return m_major >= 5; }
82 class PROJECTEXPLORER_EXPORT CeSdkHandler
86 bool parse(const QString &path);
87 inline QList<CeSdkInfo> listAll() const;
88 CeSdkInfo find(const QString &name);
89 static QString platformName(const QString &qtpath);
91 inline QString fixPaths(QString path) const;
92 QList<CeSdkInfo> m_list;
97 inline QList<CeSdkInfo> CeSdkHandler::listAll() const
102 inline QString CeSdkHandler::fixPaths(QString path) const
104 return QDir::toNativeSeparators(QDir::cleanPath(path.replace(VCINSTALL_MACRO, VCInstallDir).replace(VSINSTALL_MACRO, VSInstallDir).replace(QLatin1String(";$(PATH)"), QLatin1String(""))));
107 } // namespace Qt4ProjectManager
109 #endif // CE_SDK_HANDLER_H