author | Eckhart Koeppen <eckhart.koppen@nokia.com> |
Thu, 29 Apr 2010 15:15:16 +0300 | |
branch | RCL_3 |
changeset 16 | 4b6ee5efea19 |
parent 4 | 3b1da2848fc7 |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 4 |
** All rights reserved. |
5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 |
** |
|
7 |
** This file is part of the qmake application of the Qt Toolkit. |
|
8 |
** |
|
9 |
** $QT_BEGIN_LICENSE:LGPL$ |
|
10 |
** No Commercial Usage |
|
11 |
** This file contains pre-release code and may not be distributed. |
|
12 |
** You may use this file in accordance with the terms and conditions |
|
13 |
** contained in the Technology Preview License Agreement accompanying |
|
14 |
** this package. |
|
15 |
** |
|
16 |
** GNU Lesser General Public License Usage |
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 |
** General Public License version 2.1 as published by the Free Software |
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 |
** packaging of this file. Please review the following information to |
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 |
** |
|
24 |
** In addition, as a special exception, Nokia gives you certain additional |
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
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 |
** |
|
34 |
** |
|
35 |
** |
|
36 |
** |
|
37 |
** |
|
38 |
** $QT_END_LICENSE$ |
|
39 |
** |
|
40 |
****************************************************************************/ |
|
41 |
||
42 |
#ifndef MSVC_VCPROJ_H |
|
43 |
#define MSVC_VCPROJ_H |
|
44 |
||
45 |
#include "winmakefile.h" |
|
46 |
#include "msvc_objectmodel.h" |
|
47 |
||
48 |
QT_BEGIN_NAMESPACE |
|
49 |
||
50 |
enum Target { |
|
51 |
Application, |
|
52 |
SharedLib, |
|
53 |
StaticLib |
|
54 |
}; |
|
55 |
||
56 |
struct QUuid; |
|
57 |
class VcprojGenerator : public Win32MakefileGenerator |
|
58 |
{ |
|
59 |
bool init_flag; |
|
60 |
bool writeVcprojParts(QTextStream &); |
|
61 |
||
62 |
bool writeMakefile(QTextStream &); |
|
63 |
bool writeProjectMakefile(); |
|
64 |
void writeSubDirs(QTextStream &t); |
|
65 |
||
66 |
QString findTemplate(QString file); |
|
67 |
void init(); |
|
68 |
||
69 |
public: |
|
70 |
VcprojGenerator(); |
|
71 |
~VcprojGenerator(); |
|
72 |
||
73 |
QString defaultMakefile() const; |
|
74 |
QString precompH, precompHFilename, precompCPP, |
|
75 |
precompObj, precompPch; |
|
76 |
bool autogenPrecompCPP; |
|
77 |
static bool hasBuiltinCompiler(const QString &file); |
|
78 |
||
79 |
QMap<QString, QStringList> extraCompilerSources; |
|
80 |
QMap<QString, QStringList> extraCompilerOutputs; |
|
81 |
bool usePCH; |
|
82 |
||
83 |
protected: |
|
84 |
virtual bool doDepends() const { return false; } //never necesary |
|
85 |
virtual void processSources() { filterIncludedFiles("SOURCES"); filterIncludedFiles("GENERATED_SOURCES"); } |
|
86 |
virtual QString replaceExtraCompilerVariables(const QString &, const QStringList &, const QStringList &); |
|
87 |
inline QString replaceExtraCompilerVariables(const QString &val, const QString &in, const QString &out) |
|
88 |
{ return MakefileGenerator::replaceExtraCompilerVariables(val, in, out); } |
|
89 |
virtual bool supportsMetaBuild() { return true; } |
|
90 |
virtual bool supportsMergedBuilds() { return true; } |
|
91 |
virtual bool mergeBuildProject(MakefileGenerator *other); |
|
92 |
||
93 |
virtual bool openOutput(QFile &file, const QString &build) const; |
|
94 |
virtual void processPrlVariable(const QString &, const QStringList &); |
|
95 |
virtual bool findLibraries(); |
|
96 |
virtual void outputVariables(); |
|
97 |
QString fixFilename(QString ofile) const; |
|
98 |
||
99 |
void initOld(); |
|
100 |
virtual void initProject(); |
|
101 |
void initConfiguration(); |
|
102 |
void initCompilerTool(); |
|
103 |
void initLinkerTool(); |
|
104 |
void initLibrarianTool(); |
|
105 |
void initResourceTool(); |
|
106 |
void initIDLTool(); |
|
107 |
void initCustomBuildTool(); |
|
108 |
void initPreBuildEventTools(); |
|
109 |
void initPostBuildEventTools(); |
|
110 |
void initDeploymentTool(); |
|
111 |
void initPreLinkEventTools(); |
|
112 |
void initRootFiles(); |
|
113 |
void initSourceFiles(); |
|
114 |
void initHeaderFiles(); |
|
115 |
void initGeneratedFiles(); |
|
116 |
void initTranslationFiles(); |
|
117 |
void initFormFiles(); |
|
118 |
void initResourceFiles(); |
|
119 |
void initLexYaccFiles(); |
|
120 |
void initExtraCompilerOutputs(); |
|
121 |
||
122 |
Target projectTarget; |
|
123 |
||
124 |
// Used for single project |
|
125 |
VCProjectSingleConfig vcProject; |
|
126 |
||
127 |
// Holds all configurations for glue (merged) project |
|
128 |
QList<VcprojGenerator*> mergedProjects; |
|
129 |
||
130 |
private: |
|
131 |
QString fixCommandLine(DotNET version, const QString &input) const; |
|
132 |
QUuid getProjectUUID(const QString &filename=QString()); |
|
133 |
QUuid increaseUUID(const QUuid &id); |
|
134 |
friend class VCFilter; |
|
135 |
}; |
|
136 |
||
137 |
inline VcprojGenerator::~VcprojGenerator() |
|
138 |
{ } |
|
139 |
||
140 |
inline QString VcprojGenerator::defaultMakefile() const |
|
141 |
{ |
|
142 |
return project->first("TARGET") + project->first("VCPROJ_EXTENSION"); |
|
143 |
} |
|
144 |
||
145 |
inline bool VcprojGenerator::findLibraries() |
|
146 |
{ |
|
147 |
return Win32MakefileGenerator::findLibraries("MSVCPROJ_LIBS"); |
|
148 |
} |
|
149 |
||
150 |
QT_END_NAMESPACE |
|
151 |
||
152 |
#endif // MSVC_VCPROJ_H |