项目中集成了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)

 

相关文章:

  • 2021-10-27
  • 2022-12-23
  • 2021-09-13
  • 2022-12-23
  • 2021-06-01
  • 2021-11-09
  • 2021-12-13
  • 2019-03-27
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-20
  • 2022-12-23
  • 2022-12-23
  • 2021-09-14
  • 2021-10-04
相关资源
相似解决方案