XXX
Builds a Microsoft Visual Studio project file,
and by default builds a solution file as well.
This builds a Visual Studio project file, based on the version of
Visual Studio that is configured (either the latest installed version,
or the version specified by
&cv-MSVS_VERSION;
in the Environment constructor).
For Visual Studio 6, it will generate a
.dsp
file.
For Visual Studio 7 (.NET), it will generate a
.dsp
file.
By default,
this also generates a solution file
for the specified project,
a
.dsw
file for Visual Studio 6
or a
.sln
file for Visual Studio 7 (.NET).
This behavior may be disabled by specifying
auto_build_solution=0
when you call
&b-MSVSProject;,
in which case you presumably want to
build the solution file(s)
by calling the
&b-MSVSSolution;
Builder (see below).
It takes several lists of filenames to be placed into the project
file.
These are currently these are limited to
srcs,
incs,
localincs,
resources,
and
misc.
These are pretty self-explanatory, but it should be noted that these
lists are added to the &cv-SOURCES; construction variable as strings,
NOT as SCons File Nodes. This is because they represent file
names to be added to the project file, not the source files used to
build the project file.
In addition to the above lists of values (which are all optional,
although not specifying any of them results in an empty project file),
the following values may be specified:
target: The name of the target
.dsp
or
.vcproj
file.
The correct
suffix for the version of Visual Studio must be used,
but the
&cv-MSVSPROJECTSUFFIX;
construction variable
will be defined to the correct value (see example below).
variant:
The name of this particular variant.
For Visual Studio 7 projects,
this can also be a list of variant names.
These are typically things like "Debug" or "Release", but really
can be anything you want.
For Visual Studio 7 projects,
they may also specify a target platform
separated from the variant name by a
|
(vertical pipe)
character:
Debug|Xbox.
The default target platform is Win32.
Multiple calls to
&b-MSVSProject;
with different variants are allowed;
all variants will be added to the project file with their appropriate
build targets and sources.
buildtarget:
An optional string, node, or list of strings or nodes
(one per build variant), to tell the Visual Studio debugger
what output target to use in what build variant.
The number of
buildtarget
entries must match the number of
variant
entries.
Example usage:
barsrcs = ['bar.cpp'],
barincs = ['bar.h'],
barlocalincs = ['StdAfx.h']
barresources = ['bar.rc','resource.h']
barmisc = ['bar_readme.txt']
dll = local.SharedLibrary(target = 'bar.dll',
source = barsrcs)
local.MSVSProject(target = 'Bar' + env['MSVSPROJECTSUFFIX'],
srcs = barsrcs,
incs = barincs,
localincs = barlocalincs,
resources = barresources,
misc = barmisc,
buildtarget = dll,
variant = 'Release')
Builds a Microsoft Visual Studio solution file.
This builds a Visual Studio solution file,
based on the version of Visual Studio that is configured
(either the latest installed version,
or the version specified by
&cv-MSVS_VERSION;
in the construction environment).
For Visual Studio 6, it will generate a
dsw
file.
For Visual Studio 7 (.NET), it will
generate a
sln
file.
The following values must be specified:
target:
The name of the target .dsw or .sln file. The correct
suffix for the version of Visual Studio must be used, but the value
&cv-MSVSSOLUTIONSUFFIX;
will be defined to the correct value (see example below).
variant:
The name of this particular variant, or a list of variant
names (the latter is only supported for MSVS 7 solutions). These are
typically things like "Debug" or "Release", but really can be anything
you want. For MSVS 7 they may also specify target platform, like this
"Debug|Xbox". Default platform is Win32.
projects:
A list of project file names, or Project nodes returned by calls to the
&b-MSVSProject;
Builder,
to be placed into the solution file.
(NOTE: Currently only one project is supported per solution.)
It should be noted that these file names are NOT added to the $SOURCES
environment variable in form of files, but rather as strings. This
is because they represent file names to be added to the solution file,
not the source files used to build the solution file.
Example Usage:
local.MSVSSolution(target = 'Bar' + env['MSVSSOLUTIONSUFFIX'],
projects = ['bar' + env['MSVSPROJECTSUFFIX']],
variant = 'Release')
When the Microsoft Visual Studio tools are initialized, they set up
this dictionary with the following keys:
VERSION
the version of MSVS being used (can be set via
MSVS_VERSION)
VERSIONS
the available versions of MSVS installed
VCINSTALLDIR
installed directory of Visual C++
VSINSTALLDIR
installed directory of Visual Studio
FRAMEWORKDIR
installed directory of the .NET framework
FRAMEWORKVERSIONS
list of installed versions of the .NET framework, sorted latest to oldest.
FRAMEWORKVERSION
latest installed version of the .NET framework
FRAMEWORKSDKDIR
installed location of the .NET SDK.
PLATFORMSDKDIR
installed location of the Platform SDK.
PLATFORMSDK_MODULES
dictionary of installed Platform SDK modules,
where the dictionary keys are keywords for the various modules, and
the values are 2-tuples where the first is the release date, and the
second is the version number.
If a value isn't set, it wasn't available in the registry.
Tells the MS Visual Studio tools to use minimal INCLUDE, LIB, and PATH settings,
instead of the settings from the IDE.
For Visual Studio, SCons will (by default) automatically determine
where MSVS is installed, and use the LIB, INCLUDE, and PATH variables
set by the IDE. You can override this behavior by setting these
variables after Environment initialization, or by setting
MSVS_IGNORE_IDE_PATHS = 1
in the Environment initialization.
Specifying this will not leave these unset, but will set them to a
minimal set of paths needed to run the tools successfully.
For VS6, the mininimal set is:
INCLUDE:'VSDir\VC98\ATL\include;VSDir\VC98\MFC\include;VSDir\VC98\include'
LIB:'VSDir\VC98\MFC\lib;VSDir\VC98\lib'
PATH:'VSDir\Common\MSDev98\bin;VSDir\VC98\bin'
For VS7, it is:
INCLUDE:'VSDir\Vc7\atlmfc\include;VSDir\Vc7\include'
LIB:'VSDir\Vc7\atlmfc\lib;VSDir\Vc7\lib'
PATH:'VSDir\Common7\Tools\bin;VSDir\Common7\Tools;VSDir\Vc7\bin'
Where 'VSDir' is the installed location of Visual Studio.
The string
placed in a generated Microsoft Visual Studio solution file
as the value of the
SccProjectFilePathRelativizedFromConnection0
and
SccProjectFilePathRelativizedFromConnection1
attributes of the
GlobalSection(SourceCodeControl)
section.
There is no default value.
The string
placed in a generated Microsoft Visual Studio project file
as the value of the
ProjectGUID
attribute.
The string is also placed in the
SolutionUniqueID
attribute of the
GlobalSection(SourceCodeControl)
section of the Microsoft Visual Studio solution file.
There is no default value.
The path name
placed in a generated Microsoft Visual Studio project file
as the value of the
SccAuxPath
attribute
if the
MSVS_SCC_PROVIDER
construction variable is also set.
There is no default value.
The path name
placed in a generated Microsoft Visual Studio project file
as the value of the
SccLocalPath
attribute
if the
MSVS_SCC_PROVIDER
construction variable is also set.
The path name is also placed in the
SccLocalPath0
and
SccLocalPath1
attributes of the
GlobalSection(SourceCodeControl)
section of the Microsoft Visual Studio solution file.
There is no default value.
The project name
placed in a generated Microsoft Visual Studio project file
as the value of the
SccProjectName
attribute.
There is no default value.
The string
placed in a generated Microsoft Visual Studio project file
as the value of the
SccProvider
attribute.
The string is also placed in the
SccProvider1
attribute of the
GlobalSection(SourceCodeControl)
section of the Microsoft Visual Studio solution file.
There is no default value.
Tells the MS Visual Studio tool(s) to use
the MFC directories in its default paths
for compiling and linking.
Under MSVS version 6,
setting
MSVS_USE_MFC_DIRS
to a non-zero value
adds the
ATL\include
and
MFC\include
directories to
the default
INCLUDE
external environment variable,
and adds the
MFC\lib
directory to
the default
LIB
external environment variable.
Under MSVS version 7,
setting
MSVS_USE_MFC_DIRS
to a non-zero value
adds the
atlmfc\include
directory to the default
INCLUDE
external environment variable,
and adds the
atlmfc\lib
directory to the default
LIB
external environment variable.
The current default value is
1
which means these directories
are added to the paths by default.
This default value is likely to change
in a future release,
so users who want the ATL and MFC
values included in their paths
are encouraged to enable the
MSVS_USE_MFC_DIRS
value explicitly
to avoid future incompatibility.
This variable has no effect if the
INCLUDE
or
LIB
environment variables are set explictly.
Sets the preferred version of MSVS to use.
SCons will (by default) select the latest version of MSVS
installed on your machine.
So, if you have version 6 and version 7 (MSVS .NET) installed,
it will prefer version 7.
You can override this by
specifying the
MSVS_VERSION
variable in the Environment initialization, setting it to the
appropriate version ('6.0' or '7.0', for example).
If the given version isn't installed, tool initialization will fail.
The build command line placed in
a generated Microsoft Visual Studio project file.
The default is to have Visual Studio invoke SCons with any specified
build targets.
The clean command line placed in
a generated Microsoft Visual Studio project file.
The default is to have Visual Studio invoke SCons with the -c option
to remove any specified targets.
The encoding string placed in
a generated Microsoft Visual Studio project file.
The default is encoding
Windows-1252.
The action used to generate Microsoft Visual Studio project files.
The suffix used for Microsoft Visual Studio project (DSP) files.
The default value is
.vcproj
when using Visual Studio version 7.x (.NET),
and
.dsp
when using earlier versions of Visual Studio.
The rebuild command line placed in
a generated Microsoft Visual Studio project file.
The default is to have Visual Studio invoke SCons with any specified
rebuild targets.
The SCons used in generated Microsoft Visual Studio project files.
The default is the version of SCons being
used to generate the project file.
The SCons flags used in generated Microsoft Visual Studio
project files.
The default SCons command used in generated Microsoft Visual Studio
project files.
The sconscript file
(that is,
&SConstruct;
or
&SConscript;
file)
that will be invoked by Visual Studio
project files
(through the
&cv-MSVSSCONSCOM;
variable).
The default is the same sconscript file
that contains the call to
&b-MSVSProject;
to build the project file.
The action used to generate Microsoft Visual Studio solution files.
The suffix used for Microsoft Visual Studio solution (DSW) files.
The default value is
.sln
when using Visual Studio version 7.x (.NET),
and
.dsw
when using earlier versions of Visual Studio.
The (optional) path to the SCons library directory,
initialized from the external environment.
If set, this is used to construct a shorter and more
efficient search path in the
&cv-MSVSSCONS;
command line executed
from Microsoft Visual Studio project files.