author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 06 Jul 2010 15:10:48 +0300 | |
changeset 30 | 5dc02b23752f |
parent 18 | 2f34d5167611 |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
18
2f34d5167611
Revision: 201011
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 |
||
65 |
QString findTemplate(QString file); |
|
66 |
void init(); |
|
67 |
||
68 |
public: |
|
69 |
VcprojGenerator(); |
|
70 |
~VcprojGenerator(); |
|
71 |
||
72 |
QString defaultMakefile() const; |
|
73 |
QString precompH, precompHFilename, precompCPP, |
|
74 |
precompObj, precompPch; |
|
75 |
bool autogenPrecompCPP; |
|
76 |
static bool hasBuiltinCompiler(const QString &file); |
|
77 |
||
78 |
QMap<QString, QStringList> extraCompilerSources; |
|
79 |
QMap<QString, QStringList> extraCompilerOutputs; |
|
80 |
bool usePCH; |
|
81 |
||
82 |
protected: |
|
83 |
virtual bool doDepends() const { return false; } //never necesary |
|
84 |
virtual void processSources() { filterIncludedFiles("SOURCES"); filterIncludedFiles("GENERATED_SOURCES"); } |
|
85 |
virtual QString replaceExtraCompilerVariables(const QString &, const QStringList &, const QStringList &); |
|
86 |
inline QString replaceExtraCompilerVariables(const QString &val, const QString &in, const QString &out) |
|
87 |
{ return MakefileGenerator::replaceExtraCompilerVariables(val, in, out); } |
|
88 |
virtual bool supportsMetaBuild() { return true; } |
|
89 |
virtual bool supportsMergedBuilds() { return true; } |
|
90 |
virtual bool mergeBuildProject(MakefileGenerator *other); |
|
91 |
||
92 |
virtual bool openOutput(QFile &file, const QString &build) const; |
|
93 |
virtual void processPrlVariable(const QString &, const QStringList &); |
|
94 |
virtual bool findLibraries(); |
|
95 |
virtual void outputVariables(); |
|
96 |
QString fixFilename(QString ofile) const; |
|
97 |
||
98 |
void initOld(); |
|
99 |
virtual void initProject(); |
|
100 |
void initConfiguration(); |
|
101 |
void initCompilerTool(); |
|
102 |
void initLinkerTool(); |
|
103 |
void initLibrarianTool(); |
|
104 |
void initResourceTool(); |
|
105 |
void initIDLTool(); |
|
106 |
void initCustomBuildTool(); |
|
107 |
void initPreBuildEventTools(); |
|
108 |
void initPostBuildEventTools(); |
|
109 |
void initDeploymentTool(); |
|
110 |
void initPreLinkEventTools(); |
|
111 |
void initRootFiles(); |
|
112 |
void initSourceFiles(); |
|
113 |
void initHeaderFiles(); |
|
114 |
void initGeneratedFiles(); |
|
115 |
void initTranslationFiles(); |
|
116 |
void initFormFiles(); |
|
117 |
void initResourceFiles(); |
|
118 |
void initLexYaccFiles(); |
|
119 |
void initExtraCompilerOutputs(); |
|
120 |
||
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
121 |
void writeSubDirs(QTextStream &t); // Called from VCXProj backend |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
122 |
QUuid getProjectUUID(const QString &filename=QString()); // Called from VCXProj backend |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
123 |
|
0 | 124 |
Target projectTarget; |
125 |
||
126 |
// Used for single project |
|
127 |
VCProjectSingleConfig vcProject; |
|
128 |
||
129 |
// Holds all configurations for glue (merged) project |
|
130 |
QList<VcprojGenerator*> mergedProjects; |
|
131 |
||
132 |
private: |
|
133 |
QString fixCommandLine(DotNET version, const QString &input) const; |
|
134 |
QUuid increaseUUID(const QUuid &id); |
|
135 |
friend class VCFilter; |
|
136 |
}; |
|
137 |
||
138 |
inline VcprojGenerator::~VcprojGenerator() |
|
139 |
{ } |
|
140 |
||
141 |
inline QString VcprojGenerator::defaultMakefile() const |
|
142 |
{ |
|
143 |
return project->first("TARGET") + project->first("VCPROJ_EXTENSION"); |
|
144 |
} |
|
145 |
||
146 |
inline bool VcprojGenerator::findLibraries() |
|
147 |
{ |
|
148 |
return Win32MakefileGenerator::findLibraries("MSVCPROJ_LIBS"); |
|
149 |
} |
|
150 |
||
151 |
QT_END_NAMESPACE |
|
152 |
||
153 |
#endif // MSVC_VCPROJ_H |