From 854ca24b19169d20bd6b47c010bdbafc5fec0a0c Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 23 Feb 2018 14:43:00 +0800 Subject: [PATCH] cmake: add an alias for unit_test_framework should pass --with-test for building Boost::unit_test_framework Signed-off-by: Kefu Chai --- cmake/modules/BuildBoost.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmake/modules/BuildBoost.cmake b/cmake/modules/BuildBoost.cmake index 681e95b2f08..e71f389e0f6 100644 --- a/cmake/modules/BuildBoost.cmake +++ b/cmake/modules/BuildBoost.cmake @@ -35,6 +35,15 @@ function(check_boost_version source_dir expected_version) endif() endfunction() +macro(list_replace list old new) + list(FIND ${list} ${old} where) + if(where GREATER -1) + list(REMOVE_AT ${list} ${where}) + list(INSERT ${list} ${where} ${new}) + endif() + unset(where) +endmacro() + function(do_build_boost version) cmake_parse_arguments(Boost_BUILD "" "" COMPONENTS ${ARGN}) set(boost_features "variant=release") @@ -57,6 +66,7 @@ function(do_build_boost version) list(APPEND boost_features "cxxflags=${BOOST_CXXFLAGS}") list(FIND Boost_BUILD_COMPONENTS "python" with_python) + list_replace(Boost_BUILD_COMPONENTS "unit_test_framework" "test") string(REPLACE ";" "," boost_with_libs "${Boost_BUILD_COMPONENTS}") # build b2 and prepare the project-config.jam for boost set(configure_command -- 2.47.3