author | zecke <zecke> | 2004-07-15 17:36:57 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-07-15 17:36:57 (UTC) |
commit | 323e9a7472a110b4befba7320540263147505bae (patch) (unidiff) | |
tree | 14c810bdb9c0603a30356b17b4bdf9ccb72741c6 /qmake/generators/win32/msvc_dsp.cpp | |
parent | aa292b322f1ecb43dd8f4e3cd295855730dd9f59 (diff) | |
download | opie-323e9a7472a110b4befba7320540263147505bae.zip opie-323e9a7472a110b4befba7320540263147505bae.tar.gz opie-323e9a7472a110b4befba7320540263147505bae.tar.bz2 |
Manually updatet to qmake1.06a which includes support for precompiled
headers.
Opies 'PRO' keyword was already reintroduced
Diffstat (limited to 'qmake/generators/win32/msvc_dsp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | qmake/generators/win32/msvc_dsp.cpp | 244 |
1 files changed, 191 insertions, 53 deletions
diff --git a/qmake/generators/win32/msvc_dsp.cpp b/qmake/generators/win32/msvc_dsp.cpp index 3fa0496..d2abac6 100644 --- a/qmake/generators/win32/msvc_dsp.cpp +++ b/qmake/generators/win32/msvc_dsp.cpp | |||
@@ -1,16 +1,14 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** $Id$ | 2 | ** |
3 | ** | 3 | ** |
4 | ** Definition of ________ class. | 4 | ** Implementation of DspMakefileGenerator class. |
5 | ** | 5 | ** |
6 | ** Created : 970521 | 6 | ** Copyright (C) 1992-2003 Trolltech AS. All rights reserved. |
7 | ** | 7 | ** |
8 | ** Copyright (C) 1992-2002 Trolltech AS. All rights reserved. | 8 | ** This file is part of qmake. |
9 | ** | ||
10 | ** This file is part of the network module of the Qt GUI Toolkit. | ||
11 | ** | 9 | ** |
12 | ** This file may be distributed under the terms of the Q Public License | 10 | ** This file may be distributed under the terms of the Q Public License |
13 | ** as defined by Trolltech AS of Norway and appearing in the file | 11 | ** as defined by Trolltech AS of Norway and appearing in the file |
14 | ** LICENSE.QPL included in the packaging of this file. | 12 | ** LICENSE.QPL included in the packaging of this file. |
15 | ** | 13 | ** |
16 | ** This file may be distributed and/or modified under the terms of the | 14 | ** This file may be distributed and/or modified under the terms of the |
@@ -75,21 +73,47 @@ DspMakefileGenerator::writeDspParts(QTextStream &t) | |||
75 | QString dspfile; | 73 | QString dspfile; |
76 | if ( !project->variables()["DSP_TEMPLATE"].isEmpty() ) { | 74 | if ( !project->variables()["DSP_TEMPLATE"].isEmpty() ) { |
77 | dspfile = project->first("DSP_TEMPLATE"); | 75 | dspfile = project->first("DSP_TEMPLATE"); |
78 | } else { | 76 | } else { |
79 | dspfile = project->first("MSVCDSP_TEMPLATE"); | 77 | dspfile = project->first("MSVCDSP_TEMPLATE"); |
80 | } | 78 | } |
79 | if (dspfile.startsWith("\"") && dspfile.endsWith("\"")) | ||
80 | dspfile = dspfile.mid(1, dspfile.length() - 2); | ||
81 | QString dspfile_loc = findTemplate(dspfile); | 81 | QString dspfile_loc = findTemplate(dspfile); |
82 | 82 | ||
83 | QFile file(dspfile_loc); | 83 | QFile file(dspfile_loc); |
84 | if(!file.open(IO_ReadOnly)) { | 84 | if(!file.open(IO_ReadOnly)) { |
85 | fprintf(stderr, "Cannot open dsp file: %s\n", dspfile.latin1()); | 85 | fprintf(stderr, "Cannot open dsp file: %s\n", dspfile.latin1()); |
86 | return FALSE; | 86 | return FALSE; |
87 | } | 87 | } |
88 | QTextStream dsp(&file); | 88 | QTextStream dsp(&file); |
89 | 89 | ||
90 | QString platform = "Win32"; | ||
91 | if ( !project->variables()["QMAKE_PLATFORM"].isEmpty() ) | ||
92 | platform = varGlue("QMAKE_PLATFORM", "", " ", ""); | ||
93 | |||
94 | // Setup PCH variables | ||
95 | precompH = project->first("PRECOMPILED_HEADER"); | ||
96 | QString namePCH = QFileInfo(precompH).fileName(); | ||
97 | usePCH = !precompH.isEmpty() && project->isActiveConfig("precompile_header"); | ||
98 | if (usePCH) { | ||
99 | // Created files | ||
100 | QString origTarget = project->first("QMAKE_ORIG_TARGET"); | ||
101 | origTarget.replace(QRegExp("-"), "_"); | ||
102 | precompObj = "\"$(IntDir)\\" + origTarget + Option::obj_ext + "\""; | ||
103 | precompPch = "\"$(IntDir)\\" + origTarget + ".pch\""; | ||
104 | // Add PRECOMPILED_HEADER to HEADERS | ||
105 | if (!project->variables()["HEADERS"].contains(precompH)) | ||
106 | project->variables()["HEADERS"] += precompH; | ||
107 | // Add precompile compiler options | ||
108 | project->variables()["PRECOMPILED_FLAGS_REL"] = "/Yu\"" + namePCH + "\" /FI\"" + namePCH + "\" "; | ||
109 | project->variables()["PRECOMPILED_FLAGS_DEB"] = "/Yu\"" + namePCH + "\" /FI\"" + namePCH + "\" "; | ||
110 | // Return to variable pool | ||
111 | project->variables()["PRECOMPILED_OBJECT"] = precompObj; | ||
112 | project->variables()["PRECOMPILED_PCH"] = precompPch; | ||
113 | } | ||
90 | int rep; | 114 | int rep; |
91 | QString line; | 115 | QString line; |
92 | while ( !dsp.eof() ) { | 116 | while ( !dsp.eof() ) { |
93 | line = dsp.readLine(); | 117 | line = dsp.readLine(); |
94 | while((rep = line.find(QRegExp("\\$\\$[a-zA-Z0-9_-]*"))) != -1) { | 118 | while((rep = line.find(QRegExp("\\$\\$[a-zA-Z0-9_-]*"))) != -1) { |
95 | QString torep = line.mid(rep, line.find(QRegExp("[^\\$a-zA-Z0-9_-]"), rep) - rep); | 119 | QString torep = line.mid(rep, line.find(QRegExp("[^\\$a-zA-Z0-9_-]"), rep) - rep); |
@@ -108,27 +132,29 @@ DspMakefileGenerator::writeDspParts(QTextStream &t) | |||
108 | if(!project->isActiveConfig("flat")) | 132 | if(!project->isActiveConfig("flat")) |
109 | list.sort(); | 133 | list.sort(); |
110 | QStringList::Iterator it; | 134 | QStringList::Iterator it; |
111 | for( it = list.begin(); it != list.end(); ++it) { | 135 | for( it = list.begin(); it != list.end(); ++it) { |
112 | beginGroupForFile((*it), t); | 136 | beginGroupForFile((*it), t); |
113 | t << "# Begin Source File\n\nSOURCE=" << (*it) << endl; | 137 | t << "# Begin Source File\n\nSOURCE=" << (*it) << endl; |
114 | if ( project->isActiveConfig("moc") && (*it).endsWith(Option::moc_ext)) { | 138 | if (usePCH && (*it).endsWith(".c")) |
139 | t << "# SUBTRACT CPP /FI\"" << namePCH << "\" /Yu\"" << namePCH << "\" /Fp" << endl; | ||
140 | if ( project->isActiveConfig("moc") && (*it).endsWith(Option::cpp_moc_ext)) { | ||
115 | QString base = (*it); | 141 | QString base = (*it); |
116 | base.replace(QRegExp("\\..*$"), "").upper(); | 142 | base.replace(QRegExp("\\..*$"), "").upper(); |
117 | base.replace(QRegExp("[^a-zA-Z]"), "_"); | 143 | base.replace(QRegExp("[^a-zA-Z]"), "_"); |
118 | 144 | ||
119 | QString build = "\n\n# Begin Custom Build - Moc'ing " + findMocSource((*it)) + | 145 | QString build = "\n\n# Begin Custom Build - Moc'ing " + findMocSource((*it)) + |
120 | "...\n" "InputPath=.\\" + (*it) + "\n\n" "\"" + (*it) + "\"" | 146 | "...\n" "InputPath=.\\" + (*it) + "\n\n" "\"" + (*it) + "\"" |
121 | " : $(SOURCE) \"$(INTDIR)\" \"$(OUTDIR)\"\n" | 147 | " : $(SOURCE) \"$(INTDIR)\" \"$(OUTDIR)\"\n" |
122 | "\t" + mocpath + findMocSource((*it)) + " -o " + | 148 | "\t" + mocpath + findMocSource((*it)) + " -o " + |
123 | (*it) + "\n\n" "# End Custom Build\n\n"; | 149 | (*it) + "\n\n" "# End Custom Build\n\n"; |
124 | 150 | ||
125 | t << "USERDEP_" << base << "=\".\\" << findMocSource((*it)) << "\" \"$(QTDIR)\\bin\\moc.exe\"" << endl << endl; | 151 | t << "USERDEP_" << base << "=\".\\" << findMocSource((*it)) << "\" \"$(QTDIR)\\bin\\moc.exe\"" << endl << endl; |
126 | 152 | ||
127 | t << "!IF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - Win32 Release\"" << build | 153 | t << "!IF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - " << platform << " Release\"" << build |
128 | << "!ELSEIF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - Win32 Debug\"" | 154 | << "!ELSEIF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - " << platform << " Debug\"" |
129 | << build << "!ENDIF " << endl << endl; | 155 | << build << "!ENDIF " << endl << endl; |
130 | } | 156 | } |
131 | t << "# End Source File" << endl; | 157 | t << "# End Source File" << endl; |
132 | } | 158 | } |
133 | endGroups(t); | 159 | endGroups(t); |
134 | } else if(variable == "MSVCDSP_IMAGES") { | 160 | } else if(variable == "MSVCDSP_IMAGES") { |
@@ -143,31 +169,83 @@ DspMakefileGenerator::writeDspParts(QTextStream &t) | |||
143 | QStringList list = project->variables()["HEADERS"]; | 169 | QStringList list = project->variables()["HEADERS"]; |
144 | if(!project->isActiveConfig("flat")) | 170 | if(!project->isActiveConfig("flat")) |
145 | list.sort(); | 171 | list.sort(); |
146 | for(QStringList::Iterator it = list.begin(); it != list.end(); ++it) { | 172 | for(QStringList::Iterator it = list.begin(); it != list.end(); ++it) { |
147 | // beginGroupForFile((*it), t); | 173 | // beginGroupForFile((*it), t); |
148 | t << "# Begin Source File\n\nSOURCE=" << (*it) << endl << endl; | 174 | t << "# Begin Source File\n\nSOURCE=" << (*it) << endl << endl; |
149 | if ( project->isActiveConfig("moc") && !findMocDestination((*it)).isEmpty()) { | 175 | QString compilePCH; |
150 | QString base = (*it); | 176 | QStringList customDependencies; |
177 | QString createMOC; | ||
178 | QString buildCmdsR, buildCmdsD; | ||
179 | QString buildCmds = "\nBuildCmds= \\\n"; | ||
180 | // Create unique baseID | ||
181 | QString base = (*it); | ||
182 | { | ||
151 | base.replace(QRegExp("\\..*$"), "").upper(); | 183 | base.replace(QRegExp("\\..*$"), "").upper(); |
152 | base.replace(QRegExp("[^a-zA-Z]"), "_"); | 184 | base.replace(QRegExp("[^a-zA-Z]"), "_"); |
185 | } | ||
186 | if (usePCH && precompH.endsWith(*it)) { | ||
187 | QString basicBuildCmd = QString("\tcl.exe /TP /W3 /FD /c /D \"WIN32\" /Yc /Fp\"%1\" /Fo\"%2\" %3 %4 %5 %6 %7 %8 %9 /D \"") | ||
188 | .arg(precompPch) | ||
189 | .arg(precompObj) | ||
190 | .arg(var("MSVCDSP_INCPATH")) | ||
191 | .arg(var("MSVCDSP_DEFINES")) | ||
192 | .arg(var("MSVCDSP_CXXFLAGS")); | ||
193 | buildCmdsR = basicBuildCmd | ||
194 | .arg("/D \"NDEBUG\"") | ||
195 | .arg(var("QMAKE_CXXFLAGS_RELEASE")) | ||
196 | .arg(var("MSVCDSP_MTDEF")) | ||
197 | .arg(var("MSVCDSP_RELDEFS")); | ||
198 | buildCmdsD = basicBuildCmd | ||
199 | .arg("/D \"_DEBUG\" /Od") | ||
200 | .arg(var("QMAKE_CXXFLAGS_DEBUG")) | ||
201 | .arg(var("MSVCDSP_MTDEFD")) | ||
202 | .arg(var("MSVCDSP_DEBUG_OPT")); | ||
203 | if (project->first("TEMPLATE") == "vcapp") {// App | ||
204 | buildCmdsR += var("MSVCDSP_WINCONDEF"); | ||
205 | buildCmdsD += var("MSVCDSP_WINCONDEF"); | ||
206 | } else if (project->isActiveConfig("dll")) {// Dll | ||
207 | buildCmdsR += "_WINDOWS\" /D \"_USRDLL"; | ||
208 | buildCmdsD += "_WINDOWS\" /D \"_USRDLL"; | ||
209 | } else { // Lib | ||
210 | buildCmdsR += "_LIB"; | ||
211 | buildCmdsD += "_LIB"; | ||
212 | } | ||
213 | buildCmdsR += "\" /Fd\"$(IntDir)\\\\\" " + (*it) + " \\\n"; | ||
214 | buildCmdsD += "\" /Fd\"$(IntDir)\\\\\" " + (*it) + " \\\n"; | ||
215 | |||
216 | compilePCH = precompPch + " : $(SOURCE) \"$(INTDIR)\" \"$(OUTDIR)\"\n $(BuildCmds)\n\n"; | ||
153 | 217 | ||
218 | QStringList &tmp = findDependencies(precompH); | ||
219 | if(!tmp.isEmpty()) // Got Deps for PCH | ||
220 | customDependencies += tmp; | ||
221 | } | ||
222 | if (project->isActiveConfig("moc") && !findMocDestination((*it)).isEmpty()) { | ||
154 | QString mocpath = var( "QMAKE_MOC" ); | 223 | QString mocpath = var( "QMAKE_MOC" ); |
155 | mocpath = mocpath.replace( QRegExp( "\\..*$" ), "" ) + " "; | 224 | mocpath = mocpath.replace( QRegExp( "\\..*$" ), "" ) + " "; |
156 | 225 | buildCmds += "\t" + mocpath + (*it) + " -o " + findMocDestination((*it)) + " \\\n"; | |
157 | QString build = "\n\n# Begin Custom Build - Moc'ing " + (*it) + | 226 | createMOC = "\"" + findMocDestination((*it)) +"\" : $(SOURCE) \"$(INTDIR)\" \"$(OUTDIR)\"\n $(BuildCmds)\n\n"; |
158 | "...\n" "InputPath=.\\" + (*it) + "\n\n" "\"" + findMocDestination((*it)) + | 227 | customDependencies += "\"$(QTDIR)\\bin\\moc.exe\""; |
159 | "\"" " : $(SOURCE) \"$(INTDIR)\" \"$(OUTDIR)\"\n" | 228 | } |
160 | "\t" + mocpath + (*it) + " -o " + | 229 | if (!createMOC.isEmpty() || !compilePCH.isEmpty()) { |
161 | findMocDestination((*it)) + "\n\n" "# End Custom Build\n\n"; | 230 | bool doMOC = !createMOC.isEmpty(); |
162 | 231 | bool doPCH = !compilePCH.isEmpty(); | |
163 | t << "USERDEP_" << base << "=\"$(QTDIR)\\bin\\moc.exe\"" << endl << endl; | 232 | QString build = "\n\n# Begin Custom Build - "+ |
164 | 233 | QString(doMOC?"Moc'ing ":"") + | |
165 | t << "!IF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - Win32 Release\"" << build | 234 | QString((doMOC&&doPCH)?" and ":"") + |
166 | << "!ELSEIF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - Win32 Debug\"" | 235 | QString(doPCH?"Creating PCH cpp from ":"") + |
167 | << build << "!ENDIF " << endl << endl; | 236 | (*it) + "...\nInputPath=.\\" + (*it) + "\n\n" + |
237 | buildCmds + "%1\n" + | ||
238 | createMOC + | ||
239 | compilePCH + | ||
240 | "# End Custom Build\n\n"; | ||
241 | |||
242 | t << "USERDEP_" << base << "=" << valGlue(customDependencies, "\"", "\" \"", "\"") << endl << endl; | ||
243 | t << "!IF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - " << platform << " Release\"" << build.arg(buildCmdsR) | ||
244 | << "!ELSEIF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - " << platform << " Debug\"" << build.arg(buildCmdsD) | ||
245 | << "!ENDIF " << endl << endl; | ||
168 | } | 246 | } |
169 | t << "# End Source File" << endl; | 247 | t << "# End Source File" << endl; |
170 | } | 248 | } |
171 | // endGroups(t); | 249 | // endGroups(t); |
172 | } else if(variable == "MSVCDSP_FORMSOURCES" || variable == "MSVCDSP_FORMHEADERS") { | 250 | } else if(variable == "MSVCDSP_FORMSOURCES" || variable == "MSVCDSP_FORMHEADERS") { |
173 | if(project->variables()["FORMS"].isEmpty()) | 251 | if(project->variables()["FORMS"].isEmpty()) |
@@ -249,27 +327,27 @@ DspMakefileGenerator::writeDspParts(QTextStream &t) | |||
249 | QStringList list = project->variables()["SRCMOC"]; | 327 | QStringList list = project->variables()["SRCMOC"]; |
250 | if(!project->isActiveConfig("flat")) | 328 | if(!project->isActiveConfig("flat")) |
251 | list.sort(); | 329 | list.sort(); |
252 | for(QStringList::Iterator it = list.begin(); it != list.end(); ++it) { | 330 | for(QStringList::Iterator it = list.begin(); it != list.end(); ++it) { |
253 | // beginGroupForFile((*it), t); | 331 | // beginGroupForFile((*it), t); |
254 | t << "# Begin Source File\n\nSOURCE=" << (*it) << endl; | 332 | t << "# Begin Source File\n\nSOURCE=" << (*it) << endl; |
255 | if ( project->isActiveConfig("moc") && (*it).endsWith(Option::moc_ext)) { | 333 | if ( project->isActiveConfig("moc") && (*it).endsWith(Option::cpp_moc_ext)) { |
256 | QString base = (*it); | 334 | QString base = (*it); |
257 | base.replace(QRegExp("\\..*$"), "").upper(); | 335 | base.replace(QRegExp("\\..*$"), "").upper(); |
258 | base.replace(QRegExp("[^a-zA-Z]"), "_"); | 336 | base.replace(QRegExp("[^a-zA-Z]"), "_"); |
259 | 337 | ||
260 | QString build = "\n\n# Begin Custom Build - Moc'ing " + findMocSource((*it)) + | 338 | QString build = "\n\n# Begin Custom Build - Moc'ing " + findMocSource((*it)) + |
261 | "...\n" "InputPath=.\\" + (*it) + "\n\n" "\"" + (*it) + "\"" | 339 | "...\n" "InputPath=.\\" + (*it) + "\n\n" "\"" + (*it) + "\"" |
262 | " : $(SOURCE) \"$(INTDIR)\" \"$(OUTDIR)\"\n" | 340 | " : $(SOURCE) \"$(INTDIR)\" \"$(OUTDIR)\"\n" |
263 | "\t" + mocpath + findMocSource((*it)) + " -o " + | 341 | "\t" + mocpath + findMocSource((*it)) + " -o " + |
264 | (*it) + "\n\n" "# End Custom Build\n\n"; | 342 | (*it) + "\n\n" "# End Custom Build\n\n"; |
265 | 343 | ||
266 | t << "USERDEP_" << base << "=\".\\" << findMocSource((*it)) << "\" \"$(QTDIR)\\bin\\moc.exe\"" << endl << endl; | 344 | t << "USERDEP_" << base << "=\".\\" << findMocSource((*it)) << "\" \"$(QTDIR)\\bin\\moc.exe\"" << endl << endl; |
267 | 345 | ||
268 | t << "!IF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - Win32 Release\"" << build | 346 | t << "!IF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - " << platform << " Release\"" << build |
269 | << "!ELSEIF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - Win32 Debug\"" | 347 | << "!ELSEIF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - " << platform << " Debug\"" |
270 | << build << "!ENDIF " << endl << endl; | 348 | << build << "!ENDIF " << endl << endl; |
271 | } | 349 | } |
272 | t << "# End Source File" << endl; | 350 | t << "# End Source File" << endl; |
273 | } | 351 | } |
274 | // endGroups(t); | 352 | // endGroups(t); |
275 | } else if(variable == "MSVCDSP_PICTURES") { | 353 | } else if(variable == "MSVCDSP_PICTURES") { |
@@ -384,25 +462,26 @@ DspMakefileGenerator::writeDspParts(QTextStream &t) | |||
384 | t << "USERDEP_" << base << "=\"$(QTDIR)\\bin\\moc.exe\" \"$(QTDIR)\\bin\\uic.exe\"" << endl << endl; | 462 | t << "USERDEP_" << base << "=\"$(QTDIR)\\bin\\moc.exe\" \"$(QTDIR)\\bin\\uic.exe\"" << endl << endl; |
385 | 463 | ||
386 | QString build = "\n\n# Begin Custom Build - Uic'ing " + base + "...\n" | 464 | QString build = "\n\n# Begin Custom Build - Uic'ing " + base + "...\n" |
387 | "InputPath=.\\" + base + "\n\n" "BuildCmds= \\\n\t" + uicpath + base + | 465 | "InputPath=.\\" + base + "\n\n" "BuildCmds= \\\n\t" + uicpath + base + |
388 | " -o " + uiHeadersDir + fname + ".h \\\n" "\t" + uicpath + base + | 466 | " -o " + uiHeadersDir + fname + ".h \\\n" "\t" + uicpath + base + |
389 | " -i " + fname + ".h -o " + uiSourcesDir + fname + ".cpp \\\n" | 467 | " -i " + fname + ".h -o " + uiSourcesDir + fname + ".cpp \\\n" |
390 | "\t" + mocpath + uiHeadersDir + fname + ".h -o " + mocFile + "moc_" + fname + ".cpp \\\n"; | 468 | "\t" + mocpath + " " + uiHeadersDir + |
469 | fname + ".h -o " + mocFile + Option::h_moc_mod + fname + Option::h_moc_ext + " \\\n"; | ||
391 | 470 | ||
392 | build.append("\n\"" + uiHeadersDir + fname + ".h\" : \"$(SOURCE)\" \"$(INTDIR)\" \"$(OUTDIR)\"" "\n" | 471 | build.append("\n\"" + uiHeadersDir + fname + ".h\" : \"$(SOURCE)\" \"$(INTDIR)\" \"$(OUTDIR)\"" "\n" |
393 | "\t$(BuildCmds)\n\n" | 472 | "\t$(BuildCmds)\n\n" |
394 | "\"" + uiSourcesDir + fname + ".cpp\" : \"$(SOURCE)\" \"$(INTDIR)\" \"$(OUTDIR)\"" "\n" | 473 | "\"" + uiSourcesDir + fname + ".cpp\" : \"$(SOURCE)\" \"$(INTDIR)\" \"$(OUTDIR)\"" "\n" |
395 | "\t$(BuildCmds)\n\n" | 474 | "\t$(BuildCmds)\n\n" |
396 | "\"" + mocFile + "moc_" + fname + ".cpp\" : \"$(SOURCE)\" \"$(INTDIR)\" \"$(OUTDIR)\"" "\n" | 475 | "\"" + mocFile + Option::h_moc_mod + fname + Option::h_moc_ext + "\" : \"$(SOURCE)\" \"$(INTDIR)\" \"$(OUTDIR)\"" "\n" |
397 | "\t$(BuildCmds)\n\n"); | 476 | "\t$(BuildCmds)\n\n"); |
398 | 477 | ||
399 | build.append("# End Custom Build\n\n"); | 478 | build.append("# End Custom Build\n\n"); |
400 | 479 | ||
401 | t << "!IF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - Win32 Release\"" << build | 480 | t << "!IF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - " << platform << " Release\"" << build |
402 | << "!ELSEIF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - Win32 Debug\"" << build | 481 | << "!ELSEIF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - " << platform << " Debug\"" << build |
403 | << "!ENDIF \n\n" << "# End Source File" << endl; | 482 | << "!ENDIF \n\n" << "# End Source File" << endl; |
404 | } | 483 | } |
405 | // endGroups(t); | 484 | // endGroups(t); |
406 | t << "\n# End Group\n"; | 485 | t << "\n# End Group\n"; |
407 | } else if(variable == "MSVCDSP_LEXSOURCES") { | 486 | } else if(variable == "MSVCDSP_LEXSOURCES") { |
408 | if(project->variables()["LEXSOURCES"].isEmpty()) | 487 | if(project->variables()["LEXSOURCES"].isEmpty()) |
@@ -426,14 +505,14 @@ DspMakefileGenerator::writeDspParts(QTextStream &t) | |||
426 | "InputPath=.\\" + (*it) + "\n\n" | 505 | "InputPath=.\\" + (*it) + "\n\n" |
427 | "\"" + fname + "\" : \"$(SOURCE)\" \"$(INTDIR)\" \"$(OUTDIR)\"" "\n" | 506 | "\"" + fname + "\" : \"$(SOURCE)\" \"$(INTDIR)\" \"$(OUTDIR)\"" "\n" |
428 | "\t" + lexpath + (*it) + "\\\n" | 507 | "\t" + lexpath + (*it) + "\\\n" |
429 | "\tdel " + fname + "\\\n" | 508 | "\tdel " + fname + "\\\n" |
430 | "\tcopy lex.yy.c " + fname + "\n\n" + | 509 | "\tcopy lex.yy.c " + fname + "\n\n" + |
431 | "# End Custom Build\n\n"; | 510 | "# End Custom Build\n\n"; |
432 | t << "!IF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - Win32 Release\"" << build | 511 | t << "!IF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - " << platform << " Release\"" << build |
433 | << "!ELSEIF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - Win32 Debug\"" << build | 512 | << "!ELSEIF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - " << platform << " Debug\"" << build |
434 | << "!ENDIF \n\n" << build | 513 | << "!ENDIF \n\n" << build |
435 | 514 | ||
436 | << "# End Source File" << endl; | 515 | << "# End Source File" << endl; |
437 | } | 516 | } |
438 | // endGroups(t); | 517 | // endGroups(t); |
439 | t << "\n# End Group\n"; | 518 | t << "\n# End Group\n"; |
@@ -462,14 +541,14 @@ DspMakefileGenerator::writeDspParts(QTextStream &t) | |||
462 | "\tdel " + fname + Option::h_ext.first() + "\\\n" | 541 | "\tdel " + fname + Option::h_ext.first() + "\\\n" |
463 | "\tmove y.tab.h " + fname + Option::h_ext.first() + "\n\n" + | 542 | "\tmove y.tab.h " + fname + Option::h_ext.first() + "\n\n" + |
464 | "\tdel " + fname + Option::cpp_ext.first() + "\\\n" | 543 | "\tdel " + fname + Option::cpp_ext.first() + "\\\n" |
465 | "\tmove y.tab.c " + fname + Option::cpp_ext.first() + "\n\n" + | 544 | "\tmove y.tab.c " + fname + Option::cpp_ext.first() + "\n\n" + |
466 | "# End Custom Build\n\n"; | 545 | "# End Custom Build\n\n"; |
467 | 546 | ||
468 | t << "!IF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - Win32 Release\"" << build | 547 | t << "!IF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - " << platform << " Release\"" << build |
469 | << "!ELSEIF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - Win32 Debug\"" << build | 548 | << "!ELSEIF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - " << platform << " Debug\"" << build |
470 | << "!ENDIF \n\n" | 549 | << "!ENDIF \n\n" |
471 | << "# End Source File" << endl; | 550 | << "# End Source File" << endl; |
472 | } | 551 | } |
473 | // endGroups(t); | 552 | // endGroups(t); |
474 | t << "\n# End Group\n"; | 553 | t << "\n# End Group\n"; |
475 | } else if( variable == "MSVCDSP_CONFIGMODE" ) { | 554 | } else if( variable == "MSVCDSP_CONFIGMODE" ) { |
@@ -529,12 +608,13 @@ DspMakefileGenerator::init() | |||
529 | project->variables()["QMAKE_CXXFLAGS"] += project->variables()["QMAKE_CXXFLAGS_RTTI_ON"]; | 608 | project->variables()["QMAKE_CXXFLAGS"] += project->variables()["QMAKE_CXXFLAGS_RTTI_ON"]; |
530 | } else { | 609 | } else { |
531 | project->variables()["QMAKE_CFLAGS"] += project->variables()["QMAKE_CFLAGS_RTTI_OFF"]; | 610 | project->variables()["QMAKE_CFLAGS"] += project->variables()["QMAKE_CFLAGS_RTTI_OFF"]; |
532 | project->variables()["QMAKE_CXXFLAGS"] += project->variables()["QMAKE_CXXFLAGS_RTTI_OFF"]; | 611 | project->variables()["QMAKE_CXXFLAGS"] += project->variables()["QMAKE_CXXFLAGS_RTTI_OFF"]; |
533 | } | 612 | } |
534 | 613 | ||
614 | |||
535 | /* this should probably not be here, but I'm using it to wrap the .t files */ | 615 | /* this should probably not be here, but I'm using it to wrap the .t files */ |
536 | if(project->first("TEMPLATE") == "vcapp" ) | 616 | if(project->first("TEMPLATE") == "vcapp" ) |
537 | project->variables()["QMAKE_APP_FLAG"].append("1"); | 617 | project->variables()["QMAKE_APP_FLAG"].append("1"); |
538 | else if(project->first("TEMPLATE") == "vclib") | 618 | else if(project->first("TEMPLATE") == "vclib") |
539 | project->variables()["QMAKE_LIB_FLAG"].append("1"); | 619 | project->variables()["QMAKE_LIB_FLAG"].append("1"); |
540 | if ( project->variables()["QMAKESPEC"].isEmpty() ) | 620 | if ( project->variables()["QMAKESPEC"].isEmpty() ) |
@@ -545,12 +625,18 @@ DspMakefileGenerator::init() | |||
545 | 625 | ||
546 | QStringList &configs = project->variables()["CONFIG"]; | 626 | QStringList &configs = project->variables()["CONFIG"]; |
547 | if (project->isActiveConfig("shared")) | 627 | if (project->isActiveConfig("shared")) |
548 | project->variables()["DEFINES"].append("QT_DLL"); | 628 | project->variables()["DEFINES"].append("QT_DLL"); |
549 | if (project->isActiveConfig("qt_dll")) | 629 | if (project->isActiveConfig("qt_dll")) |
550 | if(configs.findIndex("qt") == -1) configs.append("qt"); | 630 | if(configs.findIndex("qt") == -1) configs.append("qt"); |
631 | if ( project->isActiveConfig("qtopia") ) { | ||
632 | if(configs.findIndex("qtopialib") == -1) | ||
633 | configs.append("qtopialib"); | ||
634 | if(configs.findIndex("qtopiainc") == -1) | ||
635 | configs.append("qtopiainc"); | ||
636 | } | ||
551 | if ( project->isActiveConfig("qt") ) { | 637 | if ( project->isActiveConfig("qt") ) { |
552 | if ( project->isActiveConfig( "plugin" ) ) { | 638 | if ( project->isActiveConfig( "plugin" ) ) { |
553 | project->variables()["CONFIG"].append("dll"); | 639 | project->variables()["CONFIG"].append("dll"); |
554 | project->variables()["DEFINES"].append("QT_PLUGIN"); | 640 | project->variables()["DEFINES"].append("QT_PLUGIN"); |
555 | } | 641 | } |
556 | if ( (project->variables()["DEFINES"].findIndex("QT_NODLL") == -1) && | 642 | if ( (project->variables()["DEFINES"].findIndex("QT_NODLL") == -1) && |
@@ -578,12 +664,20 @@ DspMakefileGenerator::init() | |||
578 | QString major = version.left( firstDot ); | 664 | QString major = version.left( firstDot ); |
579 | QString minor = version.right( version.length() - firstDot - 1 ); | 665 | QString minor = version.right( version.length() - firstDot - 1 ); |
580 | minor.replace( ".", "" ); | 666 | minor.replace( ".", "" ); |
581 | project->variables()["MSVCDSP_VERSION"].append( "/VERSION:" + major + "." + minor ); | 667 | project->variables()["MSVCDSP_VERSION"].append( "/VERSION:" + major + "." + minor ); |
582 | } | 668 | } |
583 | 669 | ||
670 | if ( project->isActiveConfig("qtopiainc") ) | ||
671 | project->variables()["INCLUDEPATH"] += project->variables()["QMAKE_INCDIR_QTOPIA"]; | ||
672 | if ( project->isActiveConfig("qtopialib") ) { | ||
673 | if(!project->isEmpty("QMAKE_LIBDIR_QTOPIA")) | ||
674 | project->variables()["QMAKE_LIBDIR"] += project->variables()["QMAKE_LIBDIR_QTOPIA"]; | ||
675 | project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_QTOPIA"]; | ||
676 | } | ||
677 | |||
584 | if ( project->isActiveConfig("qt") ) { | 678 | if ( project->isActiveConfig("qt") ) { |
585 | project->variables()["CONFIG"].append("moc"); | 679 | project->variables()["CONFIG"].append("moc"); |
586 | project->variables()["INCLUDEPATH"] +=project->variables()["QMAKE_INCDIR_QT"]; | 680 | project->variables()["INCLUDEPATH"] +=project->variables()["QMAKE_INCDIR_QT"]; |
587 | project->variables()["QMAKE_LIBDIR"] += project->variables()["QMAKE_LIBDIR_QT"]; | 681 | project->variables()["QMAKE_LIBDIR"] += project->variables()["QMAKE_LIBDIR_QT"]; |
588 | 682 | ||
589 | if ( is_qt && !project->variables()["QMAKE_LIB_FLAG"].isEmpty() ) { | 683 | if ( is_qt && !project->variables()["QMAKE_LIB_FLAG"].isEmpty() ) { |
@@ -631,12 +725,14 @@ DspMakefileGenerator::init() | |||
631 | else | 725 | else |
632 | project->variables()["MSVCDSP_TARGETDIRDEB"] = "Debug"; | 726 | project->variables()["MSVCDSP_TARGETDIRDEB"] = "Debug"; |
633 | project->variables()["MSVCDSP_TARGETDIRREL"] = "Release"; | 727 | project->variables()["MSVCDSP_TARGETDIRREL"] = "Release"; |
634 | } else { | 728 | } else { |
635 | if ( !project->first("OBJECTS_DIR").isEmpty() ) | 729 | if ( !project->first("OBJECTS_DIR").isEmpty() ) |
636 | project->variables()["MSVCDSP_OBJECTSDIRREL"] = project->first("OBJECTS_DIR"); | 730 | project->variables()["MSVCDSP_OBJECTSDIRREL"] = project->first("OBJECTS_DIR"); |
731 | else | ||
732 | project->variables()["MSVCDSP_OBJECTSDIRREL"] = "Release"; | ||
637 | project->variables()["MSVCDSP_OBJECTSDIRDEB"] = "Debug"; | 733 | project->variables()["MSVCDSP_OBJECTSDIRDEB"] = "Debug"; |
638 | if ( !project->first("DESTDIR").isEmpty() ) | 734 | if ( !project->first("DESTDIR").isEmpty() ) |
639 | project->variables()["MSVCDSP_TARGETDIRREL"] = project->first("DESTDIR"); | 735 | project->variables()["MSVCDSP_TARGETDIRREL"] = project->first("DESTDIR"); |
640 | else | 736 | else |
641 | project->variables()["MSVCDSP_TARGETDIRREL"] = "Release"; | 737 | project->variables()["MSVCDSP_TARGETDIRREL"] = "Release"; |
642 | project->variables()["MSVCDSP_TARGETDIRDEB"] = "Debug"; | 738 | project->variables()["MSVCDSP_TARGETDIRDEB"] = "Debug"; |
@@ -667,26 +763,51 @@ DspMakefileGenerator::init() | |||
667 | if ( project->isActiveConfig("accessibility" ) ) | 763 | if ( project->isActiveConfig("accessibility" ) ) |
668 | project->variables()[is_qt ? "PRL_EXPORT_DEFINES" : "DEFINES"].append("QT_ACCESSIBILITY_SUPPORT"); | 764 | project->variables()[is_qt ? "PRL_EXPORT_DEFINES" : "DEFINES"].append("QT_ACCESSIBILITY_SUPPORT"); |
669 | if ( project->isActiveConfig("tablet") ) | 765 | if ( project->isActiveConfig("tablet") ) |
670 | project->variables()[is_qt ? "PRL_EXPORT_DEFINES" : "DEFINES"].append("QT_TABLET_SUPPORT"); | 766 | project->variables()[is_qt ? "PRL_EXPORT_DEFINES" : "DEFINES"].append("QT_TABLET_SUPPORT"); |
671 | } | 767 | } |
672 | if ( project->isActiveConfig("dll") ) { | 768 | if ( project->isActiveConfig("dll") ) { |
769 | project->variables()["QMAKE_CFLAGS_CONSOLE_ANY"] = project->variables()["QMAKE_CFLAGS_CONSOLE_DLL"]; | ||
770 | project->variables()["QMAKE_CXXFLAGS_CONSOLE_ANY"] = project->variables()["QMAKE_CXXFLAGS_CONSOLE_DLL"]; | ||
771 | project->variables()["QMAKE_LFLAGS_CONSOLE_ANY"] = project->variables()["QMAKE_LFLAGS_CONSOLE_DLL"]; | ||
772 | project->variables()["QMAKE_LFLAGS_WINDOWS_ANY"] = project->variables()["QMAKE_LFLAGS_WINDOWS_DLL"]; | ||
673 | if ( !project->variables()["QMAKE_LIB_FLAG"].isEmpty() ) { | 773 | if ( !project->variables()["QMAKE_LIB_FLAG"].isEmpty() ) { |
674 | QString ver_xyz(project->first("VERSION")); | 774 | QString ver_xyz(project->first("VERSION")); |
675 | ver_xyz.replace(".", ""); | 775 | ver_xyz.replace(".", ""); |
676 | project->variables()["TARGET_EXT"].append(ver_xyz + ".dll"); | 776 | project->variables()["TARGET_EXT"].append(ver_xyz + ".dll"); |
677 | } else { | 777 | } else { |
678 | project->variables()["TARGET_EXT"].append(".dll"); | 778 | project->variables()["TARGET_EXT"].append(".dll"); |
679 | } | 779 | } |
680 | } else { | 780 | } else { |
781 | project->variables()["QMAKE_CFLAGS_CONSOLE_ANY"] = project->variables()["QMAKE_CFLAGS_CONSOLE"]; | ||
782 | project->variables()["QMAKE_CXXFLAGS_CONSOLE_ANY"] = project->variables()["QMAKE_CXXFLAGS_CONSOLE"]; | ||
783 | project->variables()["QMAKE_LFLAGS_CONSOLE_ANY"] = project->variables()["QMAKE_LFLAGS_CONSOLE"]; | ||
784 | project->variables()["QMAKE_LFLAGS_WINDOWS_ANY"] = project->variables()["QMAKE_LFLAGS_WINDOWS"]; | ||
681 | if ( !project->variables()["QMAKE_APP_FLAG"].isEmpty() ) | 785 | if ( !project->variables()["QMAKE_APP_FLAG"].isEmpty() ) |
682 | project->variables()["TARGET_EXT"].append(".exe"); | 786 | project->variables()["TARGET_EXT"].append(".exe"); |
683 | else | 787 | else |
684 | project->variables()["TARGET_EXT"].append(".lib"); | 788 | project->variables()["TARGET_EXT"].append(".lib"); |
685 | } | 789 | } |
686 | 790 | ||
791 | if ( project->isActiveConfig("windows") ) { | ||
792 | if ( project->isActiveConfig("console") ) { | ||
793 | project->variables()["QMAKE_CFLAGS"] += project->variables()["QMAKE_CFLAGS_CONSOLE_ANY"]; | ||
794 | project->variables()["QMAKE_CXXFLAGS"] += project->variables()["QMAKE_CXXFLAGS_CONSOLE_ANY"]; | ||
795 | project->variables()["QMAKE_LFLAGS"] += project->variables()["QMAKE_LFLAGS_CONSOLE_ANY"]; | ||
796 | project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_CONSOLE"]; | ||
797 | } else { | ||
798 | project->variables()["QMAKE_LFLAGS"] += project->variables()["QMAKE_LFLAGS_WINDOWS_ANY"]; | ||
799 | } | ||
800 | project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_WINDOWS"]; | ||
801 | } else { | ||
802 | project->variables()["QMAKE_CFLAGS"] += project->variables()["QMAKE_CFLAGS_CONSOLE_ANY"]; | ||
803 | project->variables()["QMAKE_CXXFLAGS"] += project->variables()["QMAKE_CXXFLAGS_CONSOLE_ANY"]; | ||
804 | project->variables()["QMAKE_LFLAGS"] += project->variables()["QMAKE_LFLAGS_CONSOLE_ANY"]; | ||
805 | project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_CONSOLE"]; | ||
806 | } | ||
807 | |||
687 | project->variables()["MSVCDSP_VER"] = "6.00"; | 808 | project->variables()["MSVCDSP_VER"] = "6.00"; |
688 | project->variables()["MSVCDSP_DEBUG_OPT"] = "/GZ /ZI"; | 809 | project->variables()["MSVCDSP_DEBUG_OPT"] = "/GZ /ZI"; |
689 | 810 | ||
690 | if(!project->isActiveConfig("incremental")) { | 811 | if(!project->isActiveConfig("incremental")) { |
691 | project->variables()["QMAKE_LFLAGS"].append(QString("/incremental:no")); | 812 | project->variables()["QMAKE_LFLAGS"].append(QString("/incremental:no")); |
692 | if ( is_qt ) | 813 | if ( is_qt ) |
@@ -729,48 +850,63 @@ DspMakefileGenerator::init() | |||
729 | if ( !project->variables()["QMAKE_APP_FLAG"].isEmpty() ) { | 850 | if ( !project->variables()["QMAKE_APP_FLAG"].isEmpty() ) { |
730 | project->variables()["MSVCDSP_TEMPLATE"].append("win32app" + project->first( "DSP_EXTENSION" ) ); | 851 | project->variables()["MSVCDSP_TEMPLATE"].append("win32app" + project->first( "DSP_EXTENSION" ) ); |
731 | if ( project->isActiveConfig("console") ) { | 852 | if ( project->isActiveConfig("console") ) { |
732 | project->variables()["MSVCDSP_CONSOLE"].append("Console"); | 853 | project->variables()["MSVCDSP_CONSOLE"].append("Console"); |
733 | project->variables()["MSVCDSP_WINCONDEF"].append("_CONSOLE"); | 854 | project->variables()["MSVCDSP_WINCONDEF"].append("_CONSOLE"); |
734 | project->variables()["MSVCDSP_DSPTYPE"].append("0x0103"); | 855 | project->variables()["MSVCDSP_DSPTYPE"].append("0x0103"); |
735 | project->variables()["MSVCDSP_SUBSYSTEM"].append("console"); | ||
736 | } else { | 856 | } else { |
737 | project->variables()["MSVCDSP_CONSOLE"].clear(); | 857 | project->variables()["MSVCDSP_CONSOLE"].clear(); |
738 | project->variables()["MSVCDSP_WINCONDEF"].append("_WINDOWS"); | 858 | project->variables()["MSVCDSP_WINCONDEF"].append("_WINDOWS"); |
739 | project->variables()["MSVCDSP_DSPTYPE"].append("0x0101"); | 859 | project->variables()["MSVCDSP_DSPTYPE"].append("0x0101"); |
740 | project->variables()["MSVCDSP_SUBSYSTEM"].append("windows"); | ||
741 | } | 860 | } |
742 | } else { | 861 | } else { |
743 | if ( project->isActiveConfig("dll") ) { | 862 | if ( project->isActiveConfig("dll") ) { |
744 | project->variables()["MSVCDSP_TEMPLATE"].append("win32dll" + project->first( "DSP_EXTENSION" ) ); | 863 | project->variables()["MSVCDSP_TEMPLATE"].append("win32dll" + project->first( "DSP_EXTENSION" ) ); |
745 | } else { | 864 | } else { |
746 | project->variables()["MSVCDSP_TEMPLATE"].append("win32lib" + project->first( "DSP_EXTENSION" ) ); | 865 | project->variables()["MSVCDSP_TEMPLATE"].append("win32lib" + project->first( "DSP_EXTENSION" ) ); |
747 | } | 866 | } |
748 | } | 867 | } |
749 | 868 | ||
750 | project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_WINDOWS"]; | 869 | project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_WINDOWS"]; |
870 | |||
871 | processPrlFiles(); | ||
751 | 872 | ||
873 | // Update -lname to name.lib, | ||
874 | QStringList &libs2 = project->variables()["QMAKE_LIBS"]; | ||
875 | for ( QStringList::Iterator libit2 = libs2.begin(); libit2 != libs2.end(); ++libit2 ) { | ||
876 | if ( (*libit2).startsWith( "-l" ) ) { | ||
877 | (*libit2) = (*libit2).mid( 2 ) + ".lib"; | ||
878 | } else if ( (*libit2).startsWith( "-L" ) ) { | ||
879 | project->variables()["QMAKE_LIBDIR"] += (*libit2).mid(2); | ||
880 | libit2 = libs2.remove( libit2 ); | ||
881 | } | ||
882 | } | ||
883 | |||
752 | project->variables()["MSVCDSP_LFLAGS" ] += project->variables()["QMAKE_LFLAGS"]; | 884 | project->variables()["MSVCDSP_LFLAGS" ] += project->variables()["QMAKE_LFLAGS"]; |
753 | if ( !project->variables()["QMAKE_LIBDIR"].isEmpty() ) | 885 | if ( !project->variables()["QMAKE_LIBDIR"].isEmpty() ) |
754 | project->variables()["MSVCDSP_LFLAGS" ].append(varGlue("QMAKE_LIBDIR","/LIBPATH:\"","\" /LIBPATH:\"","\"")); | 886 | project->variables()["MSVCDSP_LFLAGS" ].append(varGlue("QMAKE_LIBDIR","/LIBPATH:\"","\" /LIBPATH:\"","\"")); |
755 | project->variables()["MSVCDSP_CXXFLAGS" ] += project->variables()["QMAKE_CXXFLAGS"]; | 887 | project->variables()["MSVCDSP_CXXFLAGS" ] += project->variables()["QMAKE_CXXFLAGS"]; |
756 | project->variables()["MSVCDSP_DEFINES"].append(varGlue("DEFINES","/D ","" " /D ","")); | 888 | project->variables()["MSVCDSP_DEFINES"].append(varGlue("DEFINES","/D ","" " /D ","")); |
757 | project->variables()["MSVCDSP_DEFINES"].append(varGlue("PRL_EXPORT_DEFINES","/D ","" " /D ","")); | 889 | project->variables()["MSVCDSP_DEFINES"].append(varGlue("PRL_EXPORT_DEFINES","/D ","" " /D ","")); |
758 | 890 | ||
759 | processPrlFiles(); | 891 | if (!project->variables()["RES_FILE"].isEmpty()) |
892 | project->variables()["QMAKE_LIBS"] += project->variables()["RES_FILE"]; | ||
893 | |||
760 | QStringList &libs = project->variables()["QMAKE_LIBS"]; | 894 | QStringList &libs = project->variables()["QMAKE_LIBS"]; |
761 | for(QStringList::Iterator libit = libs.begin(); libit != libs.end(); ++libit) { | 895 | for(QStringList::Iterator libit = libs.begin(); libit != libs.end(); ++libit) { |
762 | QString lib = (*libit); | 896 | QString lib = (*libit); |
763 | lib.replace(QRegExp("\""), ""); | 897 | lib.replace(QRegExp("\""), ""); |
764 | project->variables()["MSVCDSP_LIBS"].append(" \"" + lib + "\""); | 898 | project->variables()["MSVCDSP_LIBS"].append(" \"" + lib + "\""); |
765 | } | 899 | } |
766 | 900 | ||
767 | QStringList &incs = project->variables()["INCLUDEPATH"]; | 901 | QStringList &incs = project->variables()["INCLUDEPATH"]; |
768 | for(QStringList::Iterator incit = incs.begin(); incit != incs.end(); ++incit) { | 902 | for(QStringList::Iterator incit = incs.begin(); incit != incs.end(); ++incit) { |
769 | QString inc = (*incit); | 903 | QString inc = (*incit); |
770 | inc.replace("\"", ""); | 904 | inc.replace("\"", ""); |
905 | if(inc.endsWith("\\")) // Remove trailing \'s from paths | ||
906 | inc.truncate(inc.length()-1); | ||
771 | project->variables()["MSVCDSP_INCPATH"].append("/I \"" + inc + "\""); | 907 | project->variables()["MSVCDSP_INCPATH"].append("/I \"" + inc + "\""); |
772 | } | 908 | } |
773 | 909 | ||
774 | project->variables()["MSVCDSP_INCPATH"].append("/I \"" + specdir() + "\""); | 910 | project->variables()["MSVCDSP_INCPATH"].append("/I \"" + specdir() + "\""); |
775 | if ( project->isActiveConfig("qt") ) { | 911 | if ( project->isActiveConfig("qt") ) { |
776 | project->variables()["MSVCDSP_RELDEFS"].append("/D \"QT_NO_DEBUG\""); | 912 | project->variables()["MSVCDSP_RELDEFS"].append("/D \"QT_NO_DEBUG\""); |
@@ -817,36 +953,33 @@ DspMakefileGenerator::init() | |||
817 | if ( project->isActiveConfig("activeqt") ) { | 953 | if ( project->isActiveConfig("activeqt") ) { |
818 | QString idl = project->variables()["QMAKE_IDL"].first(); | 954 | QString idl = project->variables()["QMAKE_IDL"].first(); |
819 | QString idc = project->variables()["QMAKE_IDC"].first(); | 955 | QString idc = project->variables()["QMAKE_IDC"].first(); |
820 | QString version = project->variables()["VERSION"].first(); | 956 | QString version = project->variables()["VERSION"].first(); |
821 | if ( version.isEmpty() ) | 957 | if ( version.isEmpty() ) |
822 | version = "1.0"; | 958 | version = "1.0"; |
823 | 959 | project->variables()["MSVCDSP_IDLSOURCES"].append( var("OBJECTS_DIR") + targetfilename + ".idl" ); | |
824 | project->variables()["MSVCDSP_IDLSOURCES"].append( "tmp\\" + targetfilename + ".idl" ); | ||
825 | project->variables()["MSVCDSP_IDLSOURCES"].append( "tmp\\" + targetfilename + ".tlb" ); | ||
826 | project->variables()["MSVCDSP_IDLSOURCES"].append( "tmp\\" + targetfilename + ".midl" ); | ||
827 | if ( project->isActiveConfig( "dll" ) ) { | 960 | if ( project->isActiveConfig( "dll" ) ) { |
828 | activeQtStepPreCopyDll += | 961 | activeQtStepPreCopyDll += |
829 | "\t" + idc + " %1 -idl tmp\\" + targetfilename + ".idl -version " + version + | 962 | "\t" + idc + " %1 -idl " + var("OBJECTS_DIR") + targetfilename + ".idl -version " + version + |
830 | "\t" + idl + " tmp\\" + targetfilename + ".idl /nologo /o tmp\\" + targetfilename + ".midl /tlb tmp\\" + targetfilename + ".tlb /iid tmp\\dump.midl /dlldata tmp\\dump.midl /cstub tmp\\dump.midl /header tmp\\dump.midl /proxy tmp\\dump.midl /sstub tmp\\dump.midl" | 963 | "\t" + idl + " /nologo " + var("OBJECTS_DIR") + targetfilename + ".idl /tlb " + var("OBJECTS_DIR") + targetfilename + ".tlb" + |
831 | "\t" + idc + " %1 /tlb tmp\\" + targetfilename + ".tlb"; | 964 | "\t" + idc + " %2 /tlb " + var("OBJECTS_DIR") + targetfilename + ".tlb"; |
832 | activeQtStepPostCopyDll += | 965 | activeQtStepPostCopyDll += |
833 | "\t" + idc + " %1 /regserver\n"; | 966 | "\t" + idc + " %1 /regserver\n"; |
834 | 967 | ||
835 | QString executable = project->variables()["MSVCDSP_TARGETDIRREL"].first() + "\\" + targetfilename + ".dll"; | 968 | QString executable = project->variables()["MSVCDSP_TARGETDIRREL"].first() + "\\" + targetfilename + ".dll"; |
836 | activeQtStepPreCopyDllRelease = activeQtStepPreCopyDll.arg(executable).arg(executable); | 969 | activeQtStepPreCopyDllRelease = activeQtStepPreCopyDll.arg(executable).arg(executable); |
837 | activeQtStepPostCopyDllRelease = activeQtStepPostCopyDll.arg(executable); | 970 | activeQtStepPostCopyDllRelease = activeQtStepPostCopyDll.arg(executable); |
838 | 971 | ||
839 | executable = project->variables()["MSVCDSP_TARGETDIRDEB"].first() + "\\" + targetfilename + ".dll"; | 972 | executable = project->variables()["MSVCDSP_TARGETDIRDEB"].first() + "\\" + targetfilename + ".dll"; |
840 | activeQtStepPreCopyDllDebug = activeQtStepPreCopyDll.arg(executable).arg(executable); | 973 | activeQtStepPreCopyDllDebug = activeQtStepPreCopyDll.arg(executable).arg(executable); |
841 | activeQtStepPostCopyDllDebug = activeQtStepPostCopyDll.arg(executable); | 974 | activeQtStepPostCopyDllDebug = activeQtStepPostCopyDll.arg(executable); |
842 | } else { | 975 | } else { |
843 | activeQtStepPreCopyDll += | 976 | activeQtStepPreCopyDll += |
844 | "\t%1 -dumpidl tmp\\" + targetfilename + ".idl -version " + version + | 977 | "\t%1 -dumpidl " + var("OBJECTS_DIR") + targetfilename + ".idl -version " + version + |
845 | "\t" + idl + " tmp\\" + targetfilename + ".idl /nologo /o tmp\\" + targetfilename + ".midl /tlb tmp\\" + targetfilename + ".tlb /iid tmp\\dump.midl /dlldata tmp\\dump.midl /cstub tmp\\dump.midl /header tmp\\dump.midl /proxy tmp\\dump.midl /sstub tmp\\dump.midl" | 978 | "\t" + idl + " /nologo " + var("OBJECTS_DIR") + targetfilename + ".idl /tlb " + var("OBJECTS_DIR") + targetfilename + ".tlb" + |
846 | "\t" + idc + " %1 /tlb tmp\\" + targetfilename + ".tlb"; | 979 | "\t" + idc + " %2 /tlb " + var("OBJECTS_DIR") + targetfilename + ".tlb"; |
847 | activeQtStepPostCopyDll += | 980 | activeQtStepPostCopyDll += |
848 | "\t%1 -regserver\n"; | 981 | "\t%1 -regserver\n"; |
849 | QString executable = project->variables()["MSVCDSP_TARGETDIRREL"].first() + "\\" + targetfilename + ".exe"; | 982 | QString executable = project->variables()["MSVCDSP_TARGETDIRREL"].first() + "\\" + targetfilename + ".exe"; |
850 | activeQtStepPreCopyDllRelease = activeQtStepPreCopyDll.arg(executable).arg(executable); | 983 | activeQtStepPreCopyDllRelease = activeQtStepPreCopyDll.arg(executable).arg(executable); |
851 | activeQtStepPostCopyDllRelease = activeQtStepPostCopyDll.arg(executable); | 984 | activeQtStepPostCopyDllRelease = activeQtStepPostCopyDll.arg(executable); |
852 | 985 | ||
@@ -878,13 +1011,13 @@ DspMakefileGenerator::init() | |||
878 | } | 1011 | } |
879 | QStringList &list = project->variables()["FORMS"]; | 1012 | QStringList &list = project->variables()["FORMS"]; |
880 | for( it = list.begin(); it != list.end(); ++it ) { | 1013 | for( it = list.begin(); it != list.end(); ++it ) { |
881 | if ( QFile::exists( *it + ".h" ) ) | 1014 | if ( QFile::exists( *it + ".h" ) ) |
882 | project->variables()["SOURCES"].append( *it + ".h" ); | 1015 | project->variables()["SOURCES"].append( *it + ".h" ); |
883 | } | 1016 | } |
884 | project->variables()["QMAKE_INTERNAL_PRL_LIBS"] << "MSVCDSP_LIBS"; | 1017 | project->variables()["QMAKE_INTERNAL_PRL_LIBS"] << "MSVCDSP_LIBS"; |
885 | } | 1018 | } |
886 | 1019 | ||
887 | 1020 | ||
888 | QString | 1021 | QString |
889 | DspMakefileGenerator::findTemplate(const QString &file) | 1022 | DspMakefileGenerator::findTemplate(const QString &file) |
890 | { | 1023 | { |
@@ -916,37 +1049,40 @@ DspMakefileGenerator::processPrlVariable(const QString &var, const QStringList & | |||
916 | void | 1049 | void |
917 | DspMakefileGenerator::beginGroupForFile(QString file, QTextStream &t, | 1050 | DspMakefileGenerator::beginGroupForFile(QString file, QTextStream &t, |
918 | const QString& filter) | 1051 | const QString& filter) |
919 | { | 1052 | { |
920 | if(project->isActiveConfig("flat")) | 1053 | if(project->isActiveConfig("flat")) |
921 | return; | 1054 | return; |
922 | |||
923 | fileFixify(file, QDir::currentDirPath(), QDir::currentDirPath(), TRUE); | 1055 | fileFixify(file, QDir::currentDirPath(), QDir::currentDirPath(), TRUE); |
924 | file = file.section(Option::dir_sep, 0, -2); | 1056 | file = file.section(Option::dir_sep, 0, -2); |
925 | if(file.right(Option::dir_sep.length()) != Option::dir_sep) | 1057 | if(file.right(Option::dir_sep.length()) != Option::dir_sep) |
926 | file += Option::dir_sep; | 1058 | file += Option::dir_sep; |
927 | if(file == currentGroup) | 1059 | if(file == currentGroup) |
928 | return; | 1060 | return; |
929 | 1061 | ||
930 | if(file.isEmpty() || !QDir::isRelativePath(file)) { | 1062 | if(file.isEmpty() || !QDir::isRelativePath(file)) { |
931 | endGroups(t); | 1063 | endGroups(t); |
932 | return; | 1064 | return; |
933 | } | 1065 | } |
934 | if(file.startsWith(currentGroup)) | 1066 | |
935 | file = file.mid(currentGroup.length()); | 1067 | QString tempFile = file; |
1068 | if(tempFile.startsWith(currentGroup)) | ||
1069 | tempFile = tempFile.mid(currentGroup.length()); | ||
936 | int dirSep = currentGroup.findRev( Option::dir_sep ); | 1070 | int dirSep = currentGroup.findRev( Option::dir_sep ); |
937 | while( !file.startsWith( currentGroup ) && dirSep != -1 ) { | 1071 | |
1072 | while( !tempFile.startsWith( currentGroup ) && dirSep != -1 ) { | ||
938 | currentGroup.truncate( dirSep ); | 1073 | currentGroup.truncate( dirSep ); |
939 | dirSep = currentGroup.findRev( Option::dir_sep ); | 1074 | dirSep = currentGroup.findRev( Option::dir_sep ); |
940 | if ( !file.startsWith( currentGroup ) && dirSep != -1 ) | 1075 | if ( !tempFile.startsWith( currentGroup ) && dirSep != -1 ) |
941 | t << "\n# End Group\n"; | 1076 | t << "\n# End Group\n"; |
942 | } | 1077 | } |
943 | if ( !file.startsWith( currentGroup ) ) { | 1078 | if ( !file.startsWith( currentGroup ) ) { |
944 | t << "\n# End Group\n"; | 1079 | t << "\n# End Group\n"; |
945 | currentGroup = ""; | 1080 | currentGroup = ""; |
946 | } | 1081 | } |
1082 | |||
947 | QStringList dirs = QStringList::split(Option::dir_sep, file.right( file.length() - currentGroup.length() ) ); | 1083 | QStringList dirs = QStringList::split(Option::dir_sep, file.right( file.length() - currentGroup.length() ) ); |
948 | for(QStringList::Iterator dir_it = dirs.begin(); dir_it != dirs.end(); ++dir_it) { | 1084 | for(QStringList::Iterator dir_it = dirs.begin(); dir_it != dirs.end(); ++dir_it) { |
949 | t << "# Begin Group \"" << (*dir_it) << "\"\n" | 1085 | t << "# Begin Group \"" << (*dir_it) << "\"\n" |
950 | << "# Prop Default_Filter \"" << filter << "\"\n"; | 1086 | << "# Prop Default_Filter \"" << filter << "\"\n"; |
951 | } | 1087 | } |
952 | currentGroup = file; | 1088 | currentGroup = file; |
@@ -970,12 +1106,14 @@ DspMakefileGenerator::endGroups(QTextStream &t) | |||
970 | 1106 | ||
971 | bool | 1107 | bool |
972 | DspMakefileGenerator::openOutput(QFile &file) const | 1108 | DspMakefileGenerator::openOutput(QFile &file) const |
973 | { | 1109 | { |
974 | QString outdir; | 1110 | QString outdir; |
975 | if(!file.name().isEmpty()) { | 1111 | if(!file.name().isEmpty()) { |
1112 | if(QDir::isRelativePath(file.name())) | ||
1113 | file.setName(Option::output_dir + file.name()); //pwd when qmake was run | ||
976 | QFileInfo fi(file); | 1114 | QFileInfo fi(file); |
977 | if(fi.isDir()) | 1115 | if(fi.isDir()) |
978 | outdir = file.name() + QDir::separator(); | 1116 | outdir = file.name() + QDir::separator(); |
979 | } | 1117 | } |
980 | if(!outdir.isEmpty() || file.name().isEmpty()) | 1118 | if(!outdir.isEmpty() || file.name().isEmpty()) |
981 | file.setName(outdir + project->first("TARGET") + project->first("DSP_EXTENSION")); | 1119 | file.setName(outdir + project->first("TARGET") + project->first("DSP_EXTENSION")); |