openscenegraph.sh 939 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/bash
  2. # Build OpenSceneGraph
  3. set -e
  4. if [ $1 == "release" ]; then
  5. OPTIONS="-DDYNAMIC_OPENSCENEGRAPH:BOOL=OFF -DDYNAMIC_OPENTHREADS:BOOL=OFF -DOSG_GL_LIBRARY_STATIC:BOOL=ON"
  6. else
  7. OPTIONS=""
  8. fi
  9. CORES=$(getconf _NPROCESSORS_ONLN)
  10. JOBS=$(($CORES-1))
  11. BASEDIR=$PWD/thirdparty/openscenegraph
  12. DEPLOYDIR=$BASEDIR/install
  13. OPENSCENEGRAPH_TAG="OpenSceneGraph-3.6.5"
  14. OPENSCENEGRAPH_REPO="https://github.com/openscenegraph/OpenSceneGraph"
  15. CONFIG="-DBUILD_OSG_EXAMPLES:BOOL=OFF -DBUILD_OSG_APPLICATIONS:BOOL=OFF -DOSG_TEXT_USE_FONTCONFIG:BOOL=OFF"
  16. mkdir -p "$BASEDIR"
  17. if [ -d "$DEPLOYDIR" ]; then
  18. rm -rf "$DEPLOYDIR"
  19. fi
  20. mkdir -p "$DEPLOYDIR"
  21. pushd "$BASEDIR"
  22. if [ -d "OpenSceneGraph" ]; then
  23. rm -rf "OpenSceneGraph"
  24. fi
  25. git clone --depth 1 --branch $OPENSCENEGRAPH_TAG $OPENSCENEGRAPH_REPO
  26. pushd OpenSceneGraph
  27. cmake . -DCMAKE_INSTALL_PREFIX="$DEPLOYDIR" $CONFIG $OPTIONS
  28. cmake --build . --parallel $JOBS
  29. cmake --install .
  30. popd