]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: add an alias for unit_test_framework
authorKefu Chai <kchai@redhat.com>
Fri, 23 Feb 2018 06:43:00 +0000 (14:43 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 27 Feb 2018 13:26:42 +0000 (21:26 +0800)
should pass --with-test for building Boost::unit_test_framework

Signed-off-by: Kefu Chai <kchai@redhat.com>
cmake/modules/BuildBoost.cmake

index 681e95b2f08abbe59650d0e68f8a0c8351de267a..e71f389e0f6a5d40b79751f01ac3823a5d8b6c16 100644 (file)
@@ -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