Q:

Build Boost 1.52 Libraries using Visual Studio 2012 to target Windows XP

"Visual Studio 2012 Update 1" enabled support for a Windows XP target using toolset "vc110_xp".
How do I configure Boost 1.52 to build libraries using the vc110_xp toolset ?

A:

I found the easiest way was to edit \Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat add lines to change the LIB, INCLUDE, PATH and CL variables after the defaults were loaded. Boost.Build uses this batch file so you don't need to make any other changes.
For example here is the new :x86 section
:x86
if not exist "%~dp0bin\vcvars32.bat" goto missing
call "%~dp0bin\vcvars32.bat"

set INCLUDE=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Include;%INCLUDE%
set PATH=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Bin;%PATH%
set LIB=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Lib;%LIB%
set CL=/D_USING_V110_SDK71_;%CL%

goto :SetVisualStudioVersion

Wth the four set's being the additions. A similar thing can be done for the :amd64 section, though I'm hesitant to post it as I've only tested XP 32bit myself, I've been happy to target Vista+ for 64bit builds.

