Boost做得很好,有自己的build系统,可以几乎一键式编译,这才是尼玛世界一流质量的良心开源库啊。
将Boost 1.49.0解压到boost/boost_1_49_0里面,然后在boost目录底下创建以下bat脚本:
@echo off
cd boost_1_49_0
:: build
call bootstrap.bat
bjam -j4 variant=release link=static runtime-link=static threading=multi --with-filesystem --with-locale --with-thread --with-regex --with-system --with-date_time --with-wave stage
bjam -j4 variant=debug link=static runtime-link=static threading=multi --with-filesystem --with-locale --with-thread --with-regex --with-system --with-date_time --with-wave stage
:: copy files
mkdir ..elviclib
mkdir ..elvicincludeoost
xcopy /E /Y stagelib ..elviclib
xcopy /E /Y boost ..elvicincludeoost
cd..
用Visual Studio 2008命令行运行这个脚本就会把32位的Debug和Release都生成到boost/elvic目录底下了。
如果要编译64位的build请使用以下脚本:
@echo off
cd boost_1_49_0
:: build
call bootstrap.bat
bjam -j4 architecture=x86 address-model=64 variant=release link=static runtime-link=static threading=multi --with-filesystem --with-locale --with-thread --with-regex --with-system --with-date_time stage --with-wave
bjam -j4 architecture=x86 address-model=64 variant=debug link=static runtime-link=static threading=multi --with-filesystem --with-locale --with-thread --with-regex --with-system --with-date_time stage --with-wave
:: copy files
mkdir ..elvic64lib
mkdir ..elvic64includeoost
xcopy /E /Y stagelib ..elvic64lib
xcopy /E /Y boost ..elvic64includeoost
cd..
-j4是指定使用4个进程来编译。