Newer
Older
Lais Frigerio
committed
cmake_minimum_required(VERSION 2.8)
include(ExternalProject)
# Download boost from git
SET (Boost_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/include/boost/)
SET (Boost_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/lib )
Lais Frigerio
committed
SET (BOOST_URL https://github.com/boostorg/boost.git )
SET (BOOST_BUILD ${CMAKE_CURRENT_BINARY_DIR})
Lais Frigerio
committed
if ( UNIX )
SET (FILESYSTEM_STATIC_LIBRARIES ${BOOST_BUILD}/lib/libboost_filesystem.a)
SET (SYSTEM_STATIC_LIBRARIES ${BOOST_BUILD}/lib/libboost_system.a)
Lais Frigerio
committed
endif ()
ExternalProject_Add(
boost
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/boost
GIT_REPOSITORY ${BOOST_URL}
GIT_SUBMODULES libs/assert libs/config libs/core libs/detail libs/functional libs/io libs/iterator libs/mpl libs/predef libs/preprocessor libs/range libs/smart_ptr libs/static_assert libs/throw_exception libs/type_traits libs/system libs/filesystem tools/build tools/bcp
Lais Frigerio
committed
UPDATE_COMMAND ./bootstrap.sh --with-libraries=filesystem,system --includedir=${CMAKE_BINARY_DIR}/include/
CONFIGURE_COMMAND ./b2 headers
BUILD_COMMAND ./b2 link=static install --libdir=${CMAKE_BINARY_DIR}/lib
Lais Frigerio
committed
BUILD_IN_SOURCE 1
INSTALL_COMMAND ""
)