4 This file is processed by the bin/SConsDoc.py module.
5 See its __doc__ string for a discussion of the format.
9 Sets construction variables for Microsoft Visual Studio.
27 <builder name ="MSVSProject">
29 Builds a Microsoft Visual Studio project file,
30 and by default builds a solution file as well.
32 This builds a Visual Studio project file, based on the version of
33 Visual Studio that is configured (either the latest installed version,
34 or the version specified by
35 &cv-link-MSVS_VERSION;
36 in the Environment constructor).
37 For Visual Studio 6, it will generate a
38 <filename>.dsp</filename>
40 For Visual Studio 7 (.NET) and later versions, it will generate a
41 <filename>.vcproj</filename>
45 this also generates a solution file
46 for the specified project,
48 <filename>.dsw</filename>
49 file for Visual Studio 6
51 <filename>.sln</filename>
52 file for Visual Studio 7 (.NET).
53 This behavior may be disabled by specifying
54 <literal>auto_build_solution=0</literal>
57 in which case you presumably want to
58 build the solution file(s)
63 It takes several lists of filenames to be placed into the project
65 These are currently limited to
66 <literal>srcs</literal>,
67 <literal>incs</literal>,
68 <literal>localincs</literal>,
69 <literal>resources</literal>,
71 <literal>misc</literal>.
72 These are pretty self-explanatory, but it should be noted that these
73 lists are added to the &cv-link-SOURCES; construction variable as strings,
74 NOT as SCons File Nodes. This is because they represent file
75 names to be added to the project file, not the source files used to
76 build the project file.
78 The above filename lists are all optional,
79 although at least one must be specified
80 for the resulting project file to be non-empty.
82 In addition to the above lists of values,
83 the following values may be specified:
85 <literal>target</literal>:
86 The name of the target
87 <filename>.dsp</filename>
89 <filename>.vcproj</filename>
92 suffix for the version of Visual Studio must be used,
94 &cv-link-MSVSPROJECTSUFFIX;
96 will be defined to the correct value (see example below).
98 <literal>variant</literal>:
99 The name of this particular variant.
100 For Visual Studio 7 projects,
101 this can also be a list of variant names.
102 These are typically things like "Debug" or "Release", but really
103 can be anything you want.
104 For Visual Studio 7 projects,
105 they may also specify a target platform
106 separated from the variant name by a
110 <literal>Debug|Xbox</literal>.
111 The default target platform is Win32.
114 with different variants are allowed;
115 all variants will be added to the project file with their appropriate
116 build targets and sources.
118 <literal>buildtarget</literal>:
119 An optional string, node, or list of strings or nodes
120 (one per build variant), to tell the Visual Studio debugger
121 what output target to use in what build variant.
123 <literal>buildtarget</literal>
124 entries must match the number of
125 <literal>variant</literal>
128 <literal>runfile</literal>:
129 The name of the file that Visual Studio 7 and later
131 This appears as the value of the
132 <literal>Output</literal>
133 field in the resutling Visual Studio project file.
134 If this is not specified,
135 the default is the same as the specified
136 <literal>buildtarget</literal>
142 barsrcs = ['bar.cpp'],
144 barlocalincs = ['StdAfx.h']
145 barresources = ['bar.rc','resource.h']
146 barmisc = ['bar_readme.txt']
148 dll = env.SharedLibrary(target = 'bar.dll',
151 env.MSVSProject(target = 'Bar' + env['MSVSPROJECTSUFFIX'],
154 localincs = barlocalincs,
155 resources = barresources,
163 <builder name ="MSVSSolution">
165 Builds a Microsoft Visual Studio solution file.
167 This builds a Visual Studio solution file,
168 based on the version of Visual Studio that is configured
169 (either the latest installed version,
170 or the version specified by
171 &cv-link-MSVS_VERSION;
172 in the construction environment).
173 For Visual Studio 6, it will generate a
174 <filename>.dsw</filename>
176 For Visual Studio 7 (.NET), it will
178 <filename>.sln</filename>
181 The following values must be specified:
183 <literal>target</literal>:
184 The name of the target .dsw or .sln file. The correct
185 suffix for the version of Visual Studio must be used, but the value
186 &cv-link-MSVSSOLUTIONSUFFIX;
187 will be defined to the correct value (see example below).
189 <literal>variant</literal>:
190 The name of this particular variant, or a list of variant
191 names (the latter is only supported for MSVS 7 solutions). These are
192 typically things like "Debug" or "Release", but really can be anything
193 you want. For MSVS 7 they may also specify target platform, like this
194 "Debug|Xbox". Default platform is Win32.
196 <literal>projects</literal>:
197 A list of project file names, or Project nodes returned by calls to the
200 to be placed into the solution file.
201 It should be noted that these file names are NOT added to the $SOURCES
202 environment variable in form of files, but rather as strings. This
203 is because they represent file names to be added to the solution file,
204 not the source files used to build the solution file.
206 (NOTE: Currently only one project is supported per solution.)
211 env.MSVSSolution(target = 'Bar' + env['MSVSSOLUTIONSUFFIX'],
212 projects = ['bar' + env['MSVSPROJECTSUFFIX']],
220 When the Microsoft Visual Studio tools are initialized, they set up
221 this dictionary with the following keys:
223 <envar>VERSION</envar>:
224 the version of MSVS being used (can be set via
227 <envar>VERSIONS</envar>:
228 the available versions of MSVS installed
230 <envar>VCINSTALLDIR</envar>:
231 installed directory of Visual C++
233 <envar>VSINSTALLDIR</envar>:
234 installed directory of Visual Studio
236 <envar>FRAMEWORKDIR</envar>:
237 installed directory of the .NET framework
239 <envar>FRAMEWORKVERSIONS</envar>:
240 list of installed versions of the .NET framework, sorted latest to oldest.
242 <envar>FRAMEWORKVERSION</envar>:
243 latest installed version of the .NET framework
245 <envar>FRAMEWORKSDKDIR</envar>:
246 installed location of the .NET SDK.
248 <envar>PLATFORMSDKDIR</envar>:
249 installed location of the Platform SDK.
251 <envar>PLATFORMSDK_MODULES</envar>:
252 dictionary of installed Platform SDK modules,
253 where the dictionary keys are keywords for the various modules, and
254 the values are 2-tuples where the first is the release date, and the
255 second is the version number.
257 If a value isn't set, it wasn't available in the registry.
261 <cvar name="MSVS_IGNORE_IDE_PATHS">
263 Tells the MS Visual Studio tools to use minimal INCLUDE, LIB, and PATH settings,
264 instead of the settings from the IDE.
266 For Visual Studio, SCons will (by default) automatically determine
267 where MSVS is installed, and use the LIB, INCLUDE, and PATH variables
268 set by the IDE. You can override this behavior by setting these
269 variables after Environment initialization, or by setting
270 <envar>MSVS_IGNORE_IDE_PATHS = 1</envar>
271 in the Environment initialization.
272 Specifying this will not leave these unset, but will set them to a
273 minimal set of paths needed to run the tools successfully.
275 For VS6, the mininimal set is:
277 INCLUDE:'<VSDir>\VC98\ATL\include;<VSDir>\VC98\MFC\include;<VSDir>\VC98\include'
278 LIB:'<VSDir>\VC98\MFC\lib;<VSDir>\VC98\lib'
279 PATH:'<VSDir>\Common\MSDev98\bin;<VSDir>\VC98\bin'
283 INCLUDE:'<VSDir>\Vc7\atlmfc\include;<VSDir>\Vc7\include'
284 LIB:'<VSDir>\Vc7\atlmfc\lib;<VSDir>\Vc7\lib'
285 PATH:'<VSDir>\Common7\Tools\bin;<VSDir>\Common7\Tools;<VSDir>\Vc7\bin'
288 Where '<VSDir>' is the installed location of Visual Studio.
292 <cvar name="MSVS_PROJECT_BASE_PATH">
295 placed in a generated Microsoft Visual Studio solution file
297 <literal>SccProjectFilePathRelativizedFromConnection0</literal>
299 <literal>SccProjectFilePathRelativizedFromConnection1</literal>
301 <literal>GlobalSection(SourceCodeControl)</literal>
303 There is no default value.
307 <cvar name="MSVS_PROJECT_GUID">
310 placed in a generated Microsoft Visual Studio project file
312 <literal>ProjectGUID</literal>
314 The string is also placed in the
315 <literal>SolutionUniqueID</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_AUX_PATH">
326 placed in a generated Microsoft Visual Studio project file
328 <literal>SccAuxPath</literal>
331 <envar>MSVS_SCC_PROVIDER</envar>
332 construction variable is also set.
333 There is no default value.
337 <cvar name="MSVS_SCC_LOCAL_PATH">
340 placed in a generated Microsoft Visual Studio project file
342 <literal>SccLocalPath</literal>
345 <envar>MSVS_SCC_PROVIDER</envar>
346 construction variable is also set.
347 The path name is also placed in the
348 <literal>SccLocalPath0</literal>
350 <literal>SccLocalPath1</literal>
352 <literal>GlobalSection(SourceCodeControl)</literal>
353 section of the Microsoft Visual Studio solution file.
354 There is no default value.
358 <cvar name="MSVS_SCC_PROJECT_NAME">
361 placed in a generated Microsoft Visual Studio project file
363 <literal>SccProjectName</literal>
365 There is no default value.
369 <cvar name="MSVS_SCC_PROVIDER">
372 placed in a generated Microsoft Visual Studio project file
374 <literal>SccProvider</literal>
376 The string is also placed in the
377 <literal>SccProvider1</literal>
379 <literal>GlobalSection(SourceCodeControl)</literal>
380 section of the Microsoft Visual Studio solution file.
381 There is no default value.
385 <cvar name="MSVS_USE_MFC_DIRS">
387 Tells the MS Visual Studio tool(s) to use
388 the MFC directories in its default paths
389 for compiling and linking.
390 The &cv-MSVS_USE_MFC_DIRS; variable has no effect if the
391 <envar>INCLUDE</envar>
394 environment variables are set explictly.
396 Under Visual Studio version 6,
398 &cv-MSVS_USE_MFC_DIRS;
401 <filename>ATL\include</filename>
403 <filename>MFC\include</filename>
406 <envar>INCLUDE</envar>
407 external environment variable,
409 <filename>MFC\lib</filename>
413 external environment variable.
415 Under Visual Studio version 7,
417 &cv-MSVS_USE_MFC_DIRS;
420 <filename>atlmfc\include</filename>
421 directory to the default
422 <envar>INCLUDE</envar>
423 external environment variable,
425 <filename>atlmfc\lib</filename>
426 directory to the default
428 external environment variable.
430 Under Visual Studio version 8,
432 &cv-MSVS_USE_MFC_DIRS;
433 to a non-zero value will,
436 <filename>atlmfc\include</filename>
437 directory to the default
438 <envar>INCLUDE</envar>
439 external environment variable,
441 <filename>atlmfc\lib</filename>
442 directory to the default
444 external environment variable.
446 <envar>['MSVS']['PLATFORMSDKDIR']</envar>
449 <filename>mfc</filename>
451 <filename>atl</filename>
452 subdirectories of the
453 <envar>PLATFORMSDKDIR</envar>
454 are added to the default value of the
455 <envar>INCLUDE</envar>
456 external environment variable,
457 and the default value of the
459 external environment variable is left untouched.
463 <cvar name="MSVS_VERSION">
465 Sets the preferred version of MSVS to use.
467 SCons will (by default) select the latest version of MSVS
468 installed on your machine.
469 So, if you have version 6 and version 7 (MSVS .NET) installed,
470 it will prefer version 7.
471 You can override this by
473 <envar>MSVS_VERSION</envar>
474 variable in the Environment initialization, setting it to the
475 appropriate version ('6.0' or '7.0', for example).
476 If the given version isn't installed, tool initialization will fail.
480 <cvar name="MSVSBUILDCOM">
482 The build command line placed in
483 a generated Microsoft Visual Studio project file.
484 The default is to have Visual Studio invoke SCons with any specified
489 <cvar name="MSVSCLEANCOM">
491 The clean command line placed in
492 a generated Microsoft Visual Studio project file.
493 The default is to have Visual Studio invoke SCons with the -c option
494 to remove any specified targets.
498 <cvar name="MSVSENCODING">
500 The encoding string placed in
501 a generated Microsoft Visual Studio project file.
502 The default is encoding
503 <literal>Windows-1252</literal>.
507 <cvar name="MSVSPROJECTCOM">
509 The action used to generate Microsoft Visual Studio project files.
513 <cvar name="MSVSPROJECTSUFFIX">
515 The suffix used for Microsoft Visual Studio project (DSP) files.
517 <filename>.vcproj</filename>
518 when using Visual Studio version 7.x (.NET)
521 <filename>.dsp</filename>
522 when using earlier versions of Visual Studio.
526 <cvar name="MSVSREBUILDCOM">
528 The rebuild command line placed in
529 a generated Microsoft Visual Studio project file.
530 The default is to have Visual Studio invoke SCons with any specified
535 <cvar name="MSVSSCONS">
537 The SCons used in generated Microsoft Visual Studio project files.
538 The default is the version of SCons being
539 used to generate the project file.
543 <cvar name="MSVSSCONSFLAGS">
545 The SCons flags used in generated Microsoft Visual Studio
550 <cvar name="MSVSSCONSCOM">
552 The default SCons command used in generated Microsoft Visual Studio
557 <cvar name="MSVSSCONSCRIPT">
565 that will be invoked by Visual Studio
568 &cv-link-MSVSSCONSCOM;
570 The default is the same sconscript file
571 that contains the call to
573 to build the project file.
577 <cvar name="MSVSSOLUTIONCOM">
579 The action used to generate Microsoft Visual Studio solution files.
583 <cvar name="MSVSSOLUTIONSUFFIX">
585 The suffix used for Microsoft Visual Studio solution (DSW) files.
587 <filename>.sln</filename>
588 when using Visual Studio version 7.x (.NET),
590 <filename>.dsw</filename>
591 when using earlier versions of Visual Studio.
595 <cvar name="SCONS_HOME">
597 The (optional) path to the SCons library directory,
598 initialized from the external environment.
599 If set, this is used to construct a shorter and more
600 efficient search path in the
602 command line executed
603 from Microsoft Visual Studio project files.