Code Monkey home page Code Monkey logo

learnopenglcn-notes's Introduction

LearnOpenGLCN课程学习与代码注释--Astro WANG

[说明] 执行该脚本可获取Learning OpenGL配置完整工程代码

#!/bin/sh

# This script will download the dependencies for the Learning
# OpenGL repository and compiles the source code once the
# dependencies have been installed in the install directory. The
# install directory is `../install` relative to this file.
#
# This downloads and installs
#
# - glfw
# - glm
# - assimp
# - learning opengl

d=${PWD}
bd=${d}/../
build_dir=${d}/build.unix
id=${bd}/install/

if [ ! -d ${build_dir} ] ; then
    mkdir ${build_dir}
fi

if [ ! -d ${id} ] ; then
    mkdir ${id}
fi

# GLFW
if [ ! -d ${build_dir}/glfw ] ; then
    mkdir ${build_dir}/glfw
    cd ${build_dir}/glfw
    git clone --depth 1 [email protected]:glfw/glfw.git .
    cd glfw
    git checkout 53c8c72c676ca97c10aedfe3d0eb4271c5b23dba
fi
if [ ! -d ${build_dir}/glfw/build ] ; then 
    mkdir ${build_dir}/glfw/build
fi

cd ${build_dir}/glfw/build
cmake -DGLFW_BUILD_TESTS=Off \
      -DGLFW_BUILD_DOCS=Off \
      -DGLFW_BUILD_EXAMPLES=Off \
      -DCMAKE_INSTALL_PREFIX=${id} \
      ..

if [ $? -ne 0 ] ; then
    echo "Failed to configure GLFW"
    exit
fi

cmake --build . --target install -- -j8
if [ $? -ne 0 ] ; then
    echo "Failed to build GLFW"
    exit
fi

# GLM
if [ ! -d ${build_dir}/glm ] ; then
    cd ${build_dir}
    git clone --depth 1 [email protected]:g-truc/glm.git
    cd glm
    git checkout ddebaba03308475b1e33670267eadd596d039949
fi

if [ ! -d ${build_dir}/glm/build ] ; then
    mkdir ${build_dir}/glm/build
fi

cd ${build_dir}/glm/build
cmake -DCMAKE_INSTALL_PREFIX=${id} \
      -DGLM_TEST_ENABLE=Off \
      ..

if [ $? -ne 0 ] ; then
    echo "Failed to configure GLM"
    exit
fi

cmake --build . --target install
if [ $? -ne 0 ] ; then
    echo :"Failed to install and build GLM"
    exit
fi

# ASSIMP
if [ ! -d ${build_dir}/assimp ] ; then
    cd ${build_dir}
    git clone --depth 1 [email protected]:assimp/assimp.git
    cd assimp
    git checkout 3fbe9095d157ecacf6a9549c9a21bf2ad3110ac6
fi

if [ ! -d ${build_dir}/assimp/build ] ; then
    mkdir ${build_dir}/assimp/build
fi

cd ${build_dir}/assimp/build
cmake -DCMAKE_INSTALL_PREFIX=${id} \
      -DASSIMP_BUILD_TESTS=Off \
      -DASSIMP_INSTALL_PDB=Off \
      ..
if [ $? -ne 0 ] ; then
    echo "Failed to configure assimp."
    exit
fi

cmake --build . --target install -- -j8
if [ $? -ne 0 ] ; then
    echo "Failed to build and install assimp"
    exit
fi

# Learning GL
if [ ! -d ${build_dir}/learninggl ] ; then
    cd ${build_dir}
    git clone --depth 1 [email protected]:JoeyDeVries/LearnOpenGL.git learninggl
    cd learninggl
    git checkout e2d82e2cfba74d8ed3cc2ee40f71b2bc93867eae
fi

cd ${build_dir}/learninggl
cmake -DCMAKE_PREFIX_PATH=${id} \
      -DCMAKE_INSTALL_PREFIX=${id} \
      ../../../

if [ $? -ne 0 ] ; then
    echo "Failed to configure PBR."
    exit
fi

cmake --build . -- -j8
if [ $? -ne 0 ] ; then
    echo "Failed to build PBR."
    exit
fi

learnopenglcn-notes's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.