spnda / fastgltf

A modern C++17 glTF 2.0 library focused on speed, correctness, and usability
https://fastgltf.readthedocs.io/v0.8.x/
MIT License
315 stars 48 forks source link

how to build exampes/gl_viewer? #18

Closed tigrazone closed 1 year ago

tigrazone commented 1 year ago

Please describe step by step instructions how to build gl_viewer

spnda commented 1 year ago
# Do this in the root directory
python fetch_test_deps.py

# Execute this from the build folder
cmake -DFASTGLTF_ENABLE_EXAMPLES=ON ..
cmake --build . --target fastgltf_gl_viewer

Make sure to delete your cache before reconfiguring the CMake script.

tigrazone commented 1 year ago

thank you. but I have errors on last command [ 72%] fg_glad_gl46-generate
Cleaning C:/msys64/home/user/from-git/fastgltf/build/deps/gladsources/fg_glad_gl46
Generating with args --out-path C:/msys64/home/user/from-git/fastgltf/build/deps/gladsources/fg_glad_gl46 --api gl:core=4.6 --reproducible c --loader
Traceback (most recent call last):
File "C:/msys64/mingw64/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:/msys64/mingw64/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals)
File "C:/msys64\home\user\from-git\fastgltf\deps\glad/glad/main.py", line 17, in from glad.generator import GenerationInfo
File "C:/msys64\home\user\from-git\fastgltf\deps\glad/glad/generator/init.py", line 7, in from jinja2 import Environment, ChoiceLoader, PackageLoader
ModuleNotFoundError: No module named 'jinja2'
make[3]: [deps/CMakeFiles/fg_glad_gl46.dir/build.make:78: deps/gladsources/fg_glad_gl46/include/KHR/khrplatform.h] Error 1
make[2]:
[CMakeFiles/Makefile2:346: deps/CMakeFiles/fg_glad_gl46.dir/all] Error 2
make[1]: [CMakeFiles/Makefile2:488: examples/gl_viewer/CMakeFiles/fastgltf_gl_viewer.dir/rule] Error 2
make:
[Makefile:273: fastgltf_gl_viewer] Error 2

mingw msys, windows 10

spnda commented 1 year ago

Very simple error when you remove the unnecessary:

ModuleNotFoundError: No module named 'jinja2'

You just need to install jinja2 with pip for glad to be able to generate the headers.

tigrazone commented 1 year ago

thank you. it helps. fastgltf_gl_viewer was built