1# Copyright (c) 2011-2021, The DART development contributors 2# All rights reserved. 3# 4# The list of contributors can be found at: 5# https://github.com/dartsim/dart/blob/master/LICENSE 6# 7# This file is provided under the "BSD-style" License 8 9set(DART_MIN_BOOST_VERSION 1.58.0 CACHE INTERNAL "Boost min version requirement" FORCE) 10if(MSVC) 11 add_definitions(-DBOOST_ALL_NO_LIB) 12endif() 13add_definitions(-DBOOST_TEST_DYN_LINK) 14set(Boost_USE_MULTITHREADED ON) 15set(Boost_USE_STATIC_RUNTIME OFF) 16set(BOOST_REQUIRED_COMPONENTS system filesystem) 17if(DART_VERBOSE) 18 find_package(Boost ${DART_MIN_BOOST_VERSION} REQUIRED COMPONENTS ${BOOST_REQUIRED_COMPONENTS}) 19else() 20 find_package(Boost ${DART_MIN_BOOST_VERSION} QUIET REQUIRED COMPONENTS ${BOOST_REQUIRED_COMPONENTS}) 21endif() 22 23if(NOT TARGET Boost::system) 24 add_library(Boost::system INTERFACE IMPORTED) 25 set_target_properties(Boost::system PROPERTIES 26 INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}" 27 INTERFACE_LINK_LIBRARIES "${Boost_SYSTEM_LIBRARY}" 28 ) 29endif() 30if(NOT TARGET Boost::filesystem) 31 add_library(Boost::filesystem INTERFACE IMPORTED) 32 set_target_properties(Boost::filesystem PROPERTIES 33 INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}" 34 INTERFACE_LINK_LIBRARIES "${Boost_FILESYSTEM_LIBRARY}" 35 ) 36endif() 37