diff --git a/CMakeLists.txt b/CMakeLists.txt index 115ccb7ee1..5d1ae19a8a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,8 @@ option(ENABLE_JAVA "Compile Java projects, requires a JDK and the JAVA_HOME env option(USE_EXTERNAL_GLES3 "Experimental: Compile Filament against OpenGL ES 3" OFF) +option(GENERATE_WEB_DOCS "Build WebGL documentation and tutorials" OFF) + # ================================================================================================== # OS specific # ================================================================================================== @@ -370,7 +372,10 @@ set (FILAMENT_SAMPLES_BINARY_DIR ${PROJECT_BINARY_DIR}/samples) if (WEBGL) add_subdirectory(web/filament-js) add_subdirectory(web/samples) - add_subdirectory(web/docs) + + if (GENERATE_WEB_DOCS) + add_subdirectory(web/docs) + endif() add_subdirectory(${EXTERNAL}/imgui/tnt) add_subdirectory(${EXTERNAL}/stb/tnt) diff --git a/build.sh b/build.sh index 2a98a51279..2d3bbba921 100755 --- a/build.sh +++ b/build.sh @@ -94,6 +94,8 @@ ISSUE_CMAKE_ALWAYS=false RUN_TESTS=false +WEB_DOCS_OPTION="-DGENERATE_WEB_DOCS=OFF" + ENABLE_JAVA=ON INSTALL_COMMAND= @@ -231,6 +233,7 @@ function build_webgl_with_target { -DCMAKE_BUILD_TYPE=$1 \ -DCMAKE_INSTALL_PREFIX=../webgl-${LC_TARGET}/filament \ -DWEBGL=1 \ + $WEB_DOCS_OPTION \ ../.. ${BUILD_COMMAND} ${BUILD_TARGETS} ) @@ -587,6 +590,7 @@ while getopts ":hacfijmp:tuvsl" opt; do a) ISSUE_ARCHIVES=true INSTALL_COMMAND=install + WEB_DOCS_OPTION="-DGENERATE_WEB_DOCS=ON" ;; c) ISSUE_CLEAN=true diff --git a/web/docs/build.py b/web/docs/build.py index a9396844cf..08a4089470 100755 --- a/web/docs/build.py +++ b/web/docs/build.py @@ -4,6 +4,9 @@ # To run this script, you may need to do the following on Ubuntu: # sudo apt-get install python3-pip # pip3 install -r requirements.txt +# +# If CMake is choosing /usr/bin/python3, then do this instead: +# /usr/bin/python3 -m pip requirements.txt """Converts markdown into HTML and extracts JavaScript code blocks.