# #BOOST libraries # if (WIN32) #For Visual Studio 2013 if (CMAKE_BUILD_TYPE STREQUAL Debug) set (BOOST_DEBUG_OR_RELEASE "debug") else (CMAKE_BUILD_TYPE STREQUAL Debug) set (BOOST_DEBUG_OR_RELEASE "release") endif (CMAKE_BUILD_TYPE STREQUAL Debug) if (CMAKE_CL_64) set (BOOST_ADDRESS_MODEL 64) message (STATUS "Building 64 bit") else (CMAKE_CL_64) set (BOOST_ADDRESS_MODEL 32) message (STATUS "Building 32 bit") endif (CMAKE_CL_64) #Set up to use generic msvc build environment if a specific #can not be found below set (BOOST_TOOLSET msvc) #Boost should build using the toolchain selected by CMake config #The versions of MSVC supported by boost are as follows: #Visual Studio 2003 if (MSVC_VERSION EQUAL 1310) set (BOOST_TOOLSET msvc-7.1) message (STATUS "Building boost with Visual Studio 2003") endif (MSVC_VERSION EQUAL 1310) #Visual Studio 2005 if (MSVC_VERSION EQUAL 1400) set (BOOST_TOOLSET msvc-8.0) message (STATUS "Building boost with Visual Studio 2005") endif (MSVC_VERSION EQUAL 1400) #Visual Studio 2008 if (MSVC_VERSION EQUAL 1500) set (BOOST_TOOLSET msvc-9.0) message (STATUS "Building boost with Visual Studio 2008") endif (MSVC_VERSION EQUAL 1500) #Visual Studio 2010 if (MSVC_VERSION EQUAL 1600) set (BOOST_TOOLSET msvc-10.0) message (STATUS "Building boost with Visual Studio 2010") endif (MSVC_VERSION EQUAL 1600) #Visual Studio 2012 if (MSVC_VERSION EQUAL 1700) set (BOOST_TOOLSET msvc-11.0) message (STATUS "Building boost with Visual Studio 2012") endif (MSVC_VERSION EQUAL 1700) #Visual Studio 2013 if (MSVC_VERSION EQUAL 1800) set (BOOST_TOOLSET msvc-12.0) message (STATUS "Building boost with Visual Studio 2013") endif (MSVC_VERSION EQUAL 1800) #Visual Studio 2015 if (MSVC_VERSION EQUAL 1900) set (BOOST_TOOLSET msvc-14.0) message (STATUS "Building boost with Visual Studio 2015") endif (MSVC_VERSION EQUAL 1900) ExternalProject_Add ( boost PREFIX ${CMAKE_INSTALL_PREFIX} BUILD_IN_SOURCE 1 #When running configure, the source directory must be the current directory URL https://sourceforge.net/projects/boost/files/boost/1.63.0/boost_1_63_0.tar.bz2 URL_MD5 1c837ecd990bb022d07e7aab32b09847 CONFIGURE_COMMAND ./bootstrap BUILD_COMMAND ./b2 --build-dir= toolset=${BOOST_TOOLSET} link=static address-model=${BOOST_ADDRESS_MODEL} threading=multi variant=${BOOST_DEBUG_OR_RELEASE} INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory /boost /include/boost COMMAND ${CMAKE_COMMAND} -E copy_directory /stage/lib /lib ) endif (WIN32)