1 /****************************************************************************
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 ** This file is part of the qmake application of the Qt Toolkit.
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
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.
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.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
40 ****************************************************************************/
45 #include "winmakefile.h"
46 #include "msvc_objectmodel.h"
57 class VcprojGenerator
: public Win32MakefileGenerator
60 bool writeVcprojParts(QTextStream
&);
62 bool writeMakefile(QTextStream
&);
63 bool writeProjectMakefile();
64 void writeSubDirs(QTextStream
&t
);
66 QString
findTemplate(QString file
);
73 QString
defaultMakefile() const;
74 QString precompH
, precompHFilename
, precompCPP
,
75 precompObj
, precompPch
;
76 bool autogenPrecompCPP
;
77 static bool hasBuiltinCompiler(const QString
&file
);
79 QMap
<QString
, QStringList
> extraCompilerSources
;
80 QMap
<QString
, QStringList
> extraCompilerOutputs
;
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
);
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;
100 virtual void initProject();
101 void initConfiguration();
102 void initCompilerTool();
103 void initLinkerTool();
104 void initLibrarianTool();
105 void initResourceTool();
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();
122 Target projectTarget
;
124 // Used for single project
125 VCProjectSingleConfig vcProject
;
127 // Holds all configurations for glue (merged) project
128 QList
<VcprojGenerator
*> mergedProjects
;
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
;
137 inline VcprojGenerator::~VcprojGenerator()
140 inline QString
VcprojGenerator::defaultMakefile() const
142 return project
->first("TARGET") + project
->first("VCPROJ_EXTENSION");
145 inline bool VcprojGenerator::findLibraries()
147 return Win32MakefileGenerator::findLibraries("MSVCPROJ_LIBS");
152 #endif // MSVC_VCPROJ_H