abseil的编译与使用

项目中集成了abseil。abseil提供了cmake的编译,但是缺少make install命令。

于是有了下面的的一些命令,用于生成include和lib目录。

 

function cmake_install() {
  local prefix=$1
  lib_path=$prefix/deploy/lib
  rand_lib=$lib_path/libabsl.a
  mkdir -p $lib_path
  include_path=$prefix/deploy
  mkdir -p $include_path
  #find $deploy -name "*.a" | xargs -i cp {} $lib_path
  (find $deploy -name "*.o" |  xargs ar cru $rand_lib) | (ranlib $rand_lib)
  (find $deploy -mindepth 1 -name "*.h" -print -or -name '*.inc' -print | grep -v deploy |
    sed "s,$prefix/,," | tar --create --files-from -) | (cd $include_path && tar xvfp -)
}
cmake_install $(pwd)

 

参考

增强现实的 abseil 库(1)

 

posted @ 2018-08-24 19:28  westfly  阅读(3709)  评论(0编辑  收藏  举报