install.sh 478 B

123456789101112131415161718192021
  1. #!/bin/bash
  2. function cd_dir {
  3. local dir_path=$1
  4. # 检查目录是否存在
  5. if [ ! -d "$dir_path" ]; then
  6. echo "Directory $dir_path does not exist. Creating..."
  7. mkdir -p "$dir_path"
  8. fi
  9. cd "$dir_path" || exit
  10. }
  11. cd_dir build
  12. cmake -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DINSTALL_HEADERS=ON -DINSTALL_SHARED_LIBS=OFF -DINSTALL_STATIC_LIBS=ON -DGFLAGS_NAMESPACE=google -DCMAKE_CXX_FLAGS=-fPIC ..
  13. make -j8
  14. sudo make install -j8
  15. cd ..