lib3mf.sh 670 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/bash
  2. # Build lib3mf
  3. set -e
  4. if [ $1 == "release" ]; then
  5. BASEDIR=$PWD/thirdparty/lib3mf-static
  6. OPTIONS="-DBUILD_SHARED_LIBS:BOOL=OFF"
  7. else
  8. BASEDIR=$PWD/thirdparty/lib3mf
  9. OPTIONS=""
  10. fi
  11. DEPLOYDIR=$BASEDIR/install
  12. LIB3MF_TAG="v2.1.1"
  13. LIB3MF_REPO="https://github.com/3MFConsortium/lib3mf"
  14. CONFIG="-DLIB3MF_TESTS:BOOL=OFF"
  15. mkdir -p $BASEDIR
  16. if [ -d $DEPLOYDIR ]; then
  17. rm -rf $DEPLOYDIR
  18. fi
  19. mkdir -p $DEPLOYDIR
  20. pushd $BASEDIR
  21. if [ -d "lib3mf" ]; then
  22. rm -rf "lib3mf"
  23. fi
  24. git clone --depth 1 --branch $LIB3MF_TAG $LIB3MF_REPO
  25. pushd lib3mf
  26. cmake . -DCMAKE_INSTALL_PREFIX=$DEPLOYDIR $CONFIG $OPTIONS
  27. cmake --build . --parallel
  28. cmake --install .
  29. popd