source: trunk/qmake/generators/win32/msvc_vcproj.h@ 1023

Last change on this file since 1023 was 846, checked in by Dmitry A. Kuminov, 14 years ago

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

File size: 5.0 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4** All rights reserved.
5** Contact: Nokia Corporation ([email protected])
6**
7** This file is part of the qmake application of the Qt Toolkit.
8**
9** $QT_BEGIN_LICENSE:LGPL$
10** Commercial Usage
11** Licensees holding valid Qt Commercial licenses may use this file in
12** accordance with the Qt Commercial License Agreement provided with the
13** Software or, alternatively, in accordance with the terms contained in
14** a written agreement between you and Nokia.
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** GNU General Public License Usage
29** Alternatively, this file may be used under the terms of the GNU
30** General Public License version 3.0 as published by the Free Software
31** Foundation and appearing in the file LICENSE.GPL included in the
32** packaging of this file. Please review the following information to
33** ensure the GNU General Public License version 3.0 requirements will be
34** met: http://www.gnu.org/copyleft/gpl.html.
35**
36** If you have questions regarding the use of this file, please contact
37** Nokia at [email protected].
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
48QT_BEGIN_NAMESPACE
49
50enum Target {
51 Application,
52 SharedLib,
53 StaticLib
54};
55
56struct QUuid;
57class 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
68public:
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
82protected:
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
121 void writeSubDirs(QTextStream &t); // Called from VCXProj backend
122 QUuid getProjectUUID(const QString &filename=QString()); // Called from VCXProj backend
123
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
132private:
133 QUuid increaseUUID(const QUuid &id);
134 friend class VCFilter;
135};
136
137inline VcprojGenerator::~VcprojGenerator()
138{ }
139
140inline QString VcprojGenerator::defaultMakefile() const
141{
142 return project->first("TARGET") + project->first("VCPROJ_EXTENSION");
143}
144
145inline bool VcprojGenerator::findLibraries()
146{
147 return Win32MakefileGenerator::findLibraries("MSVCPROJ_LIBS");
148}
149
150QT_END_NAMESPACE
151
152#endif // MSVC_VCPROJ_H
Note: See TracBrowser for help on using the repository browser.