Boost logo

Boost :

Subject: Re: [boost] Using both boost 64 and 32 bit on Windows with CMake
From: Michael Marcin (mike.marcin_at_[hidden])
Date: 2013-04-16 13:58:39


FWIW when using boost with CMake projects I use a slightly modified
FindBoost.cmake module.

*** /Users/jaeger/Documents/FindBoostOrig.cmake 2012-11-27
07:26:32.000000000 -0600
--- /Volumes/BOOTCAMP/code/cmake-utils/FindBoost.cmake 2013-02-15
12:40:21.000000000 -0600
***************
*** 929,934 ****
--- 929,940 ----
        endif()
     endif()

+ if(CMAKE_CL_64)
+ set(BOOST_ARCH x64)
+ else()
+ set(BOOST_ARCH x86)
+ endif()
+
     foreach(COMPONENT ${Boost_FIND_COMPONENTS})
       string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
       set( Boost_${UPPERCOMPONENT}_LIBRARY
"Boost_${UPPERCOMPONENT}_LIBRARY-NOTFOUND" )
***************
*** 967,972 ****
--- 973,979 ----
           HINTS ${_boost_LIBRARY_SEARCH_DIRS}
           ${_boost_FIND_OPTIONS}
           DOC "${_boost_docstring_release}"
+ PATH_SUFFIXES /${BOOST_ARCH}
       )

       #
***************
*** 999,1004 ****
--- 1006,1012 ----
           HINTS ${_boost_LIBRARY_SEARCH_DIRS}
           ${_boost_FIND_OPTIONS}
           DOC "${_boost_docstring_debug}"
+ PATH_SUFFIXES /${BOOST_ARCH}
       )

       if(Boost_REALPATH)

After building boost with this batch file

@echo off
ECHO build start

CALL bootstrap.bat

rmdir lib /S /Q
mkdir lib

set BUILD_OPTIONS=--build-dir=c:\boost\boost_build --layout=versioned
--stagedir=.\lib toolset=msvc-11.0 link=static threading=multi
-sNO_ZLIB=0 -sZLIB_SOURCE=c:\zlib\zlib-1.2.7

ECHO x86 START
b2 %BUILD_OPTIONS%

ren lib\lib x86
ECHO x86 END

ECHO x64 START
b2 %BUILD_OPTIONS% address-model=64
ren lib\lib x64
ECHO x64 END

ECHO build done


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk