openscenegraph.sh 916 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/bash
  2. # Build OpenSceneGraph
  3. set -e
  4. if [ $1 == "release" ]; then
  5. BASEDIR=$PWD/thirdparty/openscenegraph-static
  6. OPTIONS="-DDYNAMIC_OPENSCENEGRAPH:BOOL=OFF -DDYNAMIC_OPENTHREADS:BOOL=OFF -DOSG_GL_LIBRARY_STATIC:BOOL=ON"
  7. else
  8. BASEDIR=$PWD/thirdparty/openscenegraph
  9. OPTIONS=""
  10. fi
  11. DEPLOYDIR=$BASEDIR/install
  12. OPENSCENEGRAPH_TAG="OpenSceneGraph-3.6.5"
  13. OPENSCENEGRAPH_REPO="https://github.com/openscenegraph/OpenSceneGraph"
  14. CONFIG="-DBUILD_OSG_EXAMPLES:BOOL=OFF -DBUILD_OSG_APPLICATIONS:BOOL=OFF -DOSG_TEXT_USE_FONTCONFIG: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 "OpenSceneGraph" ]; then
  22. rm -rf "OpenSceneGraph"
  23. fi
  24. git clone --depth 1 --branch $OPENSCENEGRAPH_TAG $OPENSCENEGRAPH_REPO
  25. pushd OpenSceneGraph
  26. cmake . -DCMAKE_INSTALL_PREFIX=$DEPLOYDIR $CONFIG $OPTIONS
  27. cmake --build . --parallel
  28. cmake --install .
  29. popd