install.sh 309 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 ..
  13. make -j8
  14. sudo make install -j8
  15. cd ..