8 <builder name ="MSVSProject">
10 Builds a Microsoft Visual Studio project file,
11 and by default builds a solution file as well.
13 This builds a Visual Studio project file, based on the version of
14 Visual Studio that is configured (either the latest installed version,
15 or the version specified by
17 in the Environment constructor).
18 For Visual Studio 6, it will generate a
19 <filename>.dsp</filename>
21 For Visual Studio 7 (.NET), it will generate a
22 <filename>.dsp</filename>
26 this also generates a solution file
27 for the specified project,
29 <filename>.dsw</filename>
30 file for Visual Studio 6
32 <filename>.sln</filename>
33 file for Visual Studio 7 (.NET).
34 This behavior may be disabled by specifying
35 <literal>auto_build_solution=0</literal>
38 in which case you presumably want to
39 build the solution file(s)
44 It takes several lists of filenames to be placed into the project
46 These are currently these are limited to
47 <literal>srcs</literal>,
48 <literal>incs</literal>,
49 <literal>localincs</literal>,
50 <literal>resources</literal>,
52 <literal>misc</literal>.
53 These are pretty self-explanatory, but it should be noted that these
54 lists are added to the &cv-SOURCES; construction variable as strings,
55 NOT as SCons File Nodes. This is because they represent file
56 names to be added to the project file, not the source files used to
57 build the project file.
59 In addition to the above lists of values (which are all optional,
60 although not specifying any of them results in an empty project file),
61 the following values may be specified:
63 <literal>target</literal>: The name of the target
64 <filename>.dsp</filename>
66 <filename>.vcproj</filename>
69 suffix for the version of Visual Studio must be used,
71 &cv-MSVSPROJECTSUFFIX;
73 will be defined to the correct value (see example below).
75 <literal>variant</literal>:
76 The name of this particular variant.
77 For Visual Studio 7 projects,
78 this can also be a list of variant names.
79 These are typically things like "Debug" or "Release", but really
80 can be anything you want.
81 For Visual Studio 7 projects,
82 they may also specify a target platform
83 separated from the variant name by a
87 <literal>Debug|Xbox</literal>.
88 The default target platform is Win32.
91 with different variants are allowed;
92 all variants will be added to the project file with their appropriate
93 build targets and sources.
95 <literal>buildtarget</literal>:
96 An optional string, node, or list of strings or nodes
97 (one per build variant), to tell the Visual Studio debugger
98 what output target to use in what build variant.
100 <literal>buildtarget</literal>
101 entries must match the number of
102 <literal>variant</literal>
108 barsrcs = ['bar.cpp'],
110 barlocalincs = ['StdAfx.h']
111 barresources = ['bar.rc','resource.h']
112 barmisc = ['bar_readme.txt']
114 dll = local.SharedLibrary(target = 'bar.dll',
117 local.MSVSProject(target = 'Bar' + env['MSVSPROJECTSUFFIX'],
120 localincs = barlocalincs,
121 resources = barresources,
129 <builder name ="MSVSSolution">
131 Builds a Microsoft Visual Studio solution file.
133 This builds a Visual Studio solution file,
134 based on the version of Visual Studio that is configured
135 (either the latest installed version,
136 or the version specified by
138 in the construction environment).
139 For Visual Studio 6, it will generate a
140 <filename>dsw</filename>
142 For Visual Studio 7 (.NET), it will
144 <filename>sln</filename>
147 The following values must be specified:
149 <literal>target</literal>:
150 The name of the target .dsw or .sln file. The correct
151 suffix for the version of Visual Studio must be used, but the value
152 &cv-MSVSSOLUTIONSUFFIX;
153 will be defined to the correct value (see example below).
155 <literal>variant</literal>:
156 The name of this particular variant, or a list of variant
157 names (the latter is only supported for MSVS 7 solutions). These are
158 typically things like "Debug" or "Release", but really can be anything
159 you want. For MSVS 7 they may also specify target platform, like this
160 "Debug|Xbox". Default platform is Win32.
162 <literal>projects</literal>:
163 A list of project file names, or Project nodes returned by calls to the
166 to be placed into the solution file.
167 (NOTE: Currently only one project is supported per solution.)
168 It should be noted that these file names are NOT added to the $SOURCES
169 environment variable in form of files, but rather as strings. This
170 is because they represent file names to be added to the solution file,
171 not the source files used to build the solution file.
176 local.MSVSSolution(target = 'Bar' + env['MSVSSOLUTIONSUFFIX'],
177 projects = ['bar' + env['MSVSPROJECTSUFFIX']],
185 When the Microsoft Visual Studio tools are initialized, they set up
186 this dictionary with the following keys:
188 <envar>VERSION</envar>
189 the version of MSVS being used (can be set via
192 <envar>VERSIONS</envar>
193 the available versions of MSVS installed
195 <envar>VCINSTALLDIR</envar>
196 installed directory of Visual C++
198 <envar>VSINSTALLDIR</envar>
199 installed directory of Visual Studio
201 <envar>FRAMEWORKDIR</envar>
202 installed directory of the .NET framework
204 <envar>FRAMEWORKVERSIONS</envar>
205 list of installed versions of the .NET framework, sorted latest to oldest.
207 <envar>FRAMEWORKVERSION</envar>
208 latest installed version of the .NET framework
210 <envar>FRAMEWORKSDKDIR</envar>
211 installed location of the .NET SDK.
213 <envar>PLATFORMSDKDIR</envar>
214 installed location of the Platform SDK.
216 <envar>PLATFORMSDK_MODULES</envar>
217 dictionary of installed Platform SDK modules,
218 where the dictionary keys are keywords for the various modules, and
219 the values are 2-tuples where the first is the release date, and the
220 second is the version number.
222 If a value isn't set, it wasn't available in the registry.
226 <cvar name="MSVS_IGNORE_IDE_PATHS">
228 Tells the MS Visual Studio tools to use minimal INCLUDE, LIB, and PATH settings,
229 instead of the settings from the IDE.
231 For Visual Studio, SCons will (by default) automatically determine
232 where MSVS is installed, and use the LIB, INCLUDE, and PATH variables
233 set by the IDE. You can override this behavior by setting these
234 variables after Environment initialization, or by setting
235 <envar>MSVS_IGNORE_IDE_PATHS = 1</envar>
236 in the Environment initialization.
237 Specifying this will not leave these unset, but will set them to a
238 minimal set of paths needed to run the tools successfully.
240 For VS6, the mininimal set is:
242 INCLUDE:'VSDir\VC98\ATL\include;VSDir\VC98\MFC\include;VSDir\VC98\include'
243 LIB:'VSDir\VC98\MFC\lib;VSDir\VC98\lib'
244 PATH:'VSDir\Common\MSDev98\bin;VSDir\VC98\bin'
248 INCLUDE:'VSDir\Vc7\atlmfc\include;VSDir\Vc7\include'
249 LIB:'VSDir\Vc7\atlmfc\lib;VSDir\Vc7\lib'
250 PATH:'VSDir\Common7\Tools\bin;VSDir\Common7\Tools;VSDir\Vc7\bin'
253 Where 'VSDir' is the installed location of Visual Studio.
257 <cvar name="MSVS_PROJECT_BASE_PATH">
260 placed in a generated Microsoft Visual Studio solution file
262 <literal>SccProjectFilePathRelativizedFromConnection0</literal>
264 <literal>SccProjectFilePathRelativizedFromConnection1</literal>
266 <literal>GlobalSection(SourceCodeControl)</literal>
268 There is no default value.
272 <cvar name="MSVS_PROJECT_GUID">
275 placed in a generated Microsoft Visual Studio project file
277 <literal>ProjectGUID</literal>
279 The string is also placed in the
280 <literal>SolutionUniqueID</literal>
282 <literal>GlobalSection(SourceCodeControl)</literal>
283 section of the Microsoft Visual Studio solution file.
284 There is no default value.
288 <cvar name="MSVS_SCC_AUX_PATH">
291 placed in a generated Microsoft Visual Studio project file
293 <literal>SccAuxPath</literal>
296 <envar>MSVS_SCC_PROVIDER</envar>
297 construction variable is also set.
298 There is no default value.
302 <cvar name="MSVS_SCC_LOCAL_PATH">
305 placed in a generated Microsoft Visual Studio project file
307 <literal>SccLocalPath</literal>
310 <envar>MSVS_SCC_PROVIDER</envar>
311 construction variable is also set.
312 The path name is also placed in the
313 <literal>SccLocalPath0</literal>
315 <literal>SccLocalPath1</literal>
317 <literal>GlobalSection(SourceCodeControl)</literal>
318 section of the Microsoft Visual Studio solution file.
319 There is no default value.
323 <cvar name="MSVS_SCC_PROJECT_NAME">
326 placed in a generated Microsoft Visual Studio project file
328 <literal>SccProjectName</literal>
330 There is no default value.
334 <cvar name="MSVS_SCC_PROVIDER">
337 placed in a generated Microsoft Visual Studio project file
339 <literal>SccProvider</literal>
341 The string is also placed in the
342 <literal>SccProvider1</literal>
344 <literal>GlobalSection(SourceCodeControl)</literal>
345 section of the Microsoft Visual Studio solution file.
346 There is no default value.
350 <cvar name="MSVS_USE_MFC_DIRS">
352 Tells the MS Visual Studio tool(s) to use
353 the MFC directories in its default paths
354 for compiling and linking.
355 Under MSVS version 6,
357 <envar>MSVS_USE_MFC_DIRS</envar>
360 <filename>ATL\include</filename>
362 <filename>MFC\include</filename>
365 <envar>INCLUDE</envar>
366 external environment variable,
368 <envar>MFC\lib</envar>
372 external environment variable.
373 Under MSVS version 7,
375 <envar>MSVS_USE_MFC_DIRS</envar>
378 <envar>atlmfc\include</envar>
379 directory to the default
380 <envar>INCLUDE</envar>
381 external environment variable,
383 <envar>atlmfc\lib</envar>
384 directory to the default
386 external environment variable.
387 The current default value is
389 which means these directories
390 are added to the paths by default.
391 This default value is likely to change
393 so users who want the ATL and MFC
394 values included in their paths
395 are encouraged to enable the
396 <envar>MSVS_USE_MFC_DIRS</envar>
398 to avoid future incompatibility.
399 This variable has no effect if the
400 <envar>INCLUDE</envar>
403 environment variables are set explictly.
407 <cvar name="MSVS_VERSION">
409 Sets the preferred version of MSVS to use.
411 SCons will (by default) select the latest version of MSVS
412 installed on your machine.
413 So, if you have version 6 and version 7 (MSVS .NET) installed,
414 it will prefer version 7.
415 You can override this by
417 <envar>MSVS_VERSION</envar>
418 variable in the Environment initialization, setting it to the
419 appropriate version ('6.0' or '7.0', for example).
420 If the given version isn't installed, tool initialization will fail.
424 <cvar name="MSVSBUILDCOM">
426 The build command line placed in
427 a generated Microsoft Visual Studio project file.
428 The default is to have Visual Studio invoke SCons with any specified
433 <cvar name="MSVSCLEANCOM">
435 The clean command line placed in
436 a generated Microsoft Visual Studio project file.
437 The default is to have Visual Studio invoke SCons with the -c option
438 to remove any specified targets.
442 <cvar name="MSVSENCODING">
444 The encoding string placed in
445 a generated Microsoft Visual Studio project file.
446 The default is encoding
447 <literal>Windows-1252</literal>.
451 <cvar name="MSVSPROJECTCOM">
453 The action used to generate Microsoft Visual Studio project files.
457 <cvar name="MSVSPROJECTSUFFIX">
459 The suffix used for Microsoft Visual Studio project (DSP) files.
461 <filename>.vcproj</filename>
462 when using Visual Studio version 7.x (.NET),
464 <filename>.dsp</filename>
465 when using earlier versions of Visual Studio.
469 <cvar name="MSVSREBUILDCOM">
471 The rebuild command line placed in
472 a generated Microsoft Visual Studio project file.
473 The default is to have Visual Studio invoke SCons with any specified
478 <cvar name="MSVSSCONS">
480 The SCons used in generated Microsoft Visual Studio project files.
481 The default is the version of SCons being
482 used to generate the project file.
486 <cvar name="MSVSSCONSFLAGS">
488 The SCons flags used in generated Microsoft Visual Studio
493 <cvar name="MSVSSCONSCOM">
495 The default SCons command used in generated Microsoft Visual Studio
500 <cvar name="MSVSSCONSCRIPT">
508 that will be invoked by Visual Studio
513 The default is the same sconscript file
514 that contains the call to
516 to build the project file.
520 <cvar name="MSVSSOLUTIONCOM">
522 The action used to generate Microsoft Visual Studio solution files.
526 <cvar name="MSVSSOLUTIONSUFFIX">
528 The suffix used for Microsoft Visual Studio solution (DSW) files.
530 <filename>.sln</filename>
531 when using Visual Studio version 7.x (.NET),
533 <filename>.dsw</filename>
534 when using earlier versions of Visual Studio.