1# Copyright Louis Dionne 2016 2# Copyright Zach Laine 2016-2017 3# Distributed under the Boost Software License, Version 1.0. 4# (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) 5 6############################################################################### 7# Boost 8############################################################################### 9set(Boost_USE_STATIC_LIBS ON) 10if (NOT BOOST_BRANCH) 11 set(BOOST_BRANCH master) 12endif() 13add_custom_target( 14 boost_root_clone 15 git clone --depth 100 -b ${BOOST_BRANCH} 16 https://github.com/boostorg/boost.git boost_root 17 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) 18if (MSVC) 19 set(bootstrap_cmd ./bootstrap.bat) 20else() 21 set(bootstrap_cmd ./bootstrap.sh) 22endif() 23add_custom_target( 24 boost_clone 25 COMMAND git submodule init libs/assert 26 COMMAND git submodule init libs/config 27 COMMAND git submodule init libs/core 28 COMMAND git submodule init tools/build 29 COMMAND git submodule init libs/headers 30 COMMAND git submodule init tools/boost_install 31 COMMAND git submodule update --jobs 3 32 COMMAND ${bootstrap_cmd} 33 COMMAND ./b2 headers 34 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/boost_root 35 DEPENDS boost_root_clone) 36add_library(boost INTERFACE) 37add_dependencies(boost boost_clone) 38target_include_directories(boost INTERFACE ${CMAKE_BINARY_DIR}/boost_root) 39