-
Notifications
You must be signed in to change notification settings - Fork 59
Description
I had a hell of a time figuring out how to build from source with GLM 0.9.9.9, i.e. latest master of https://github.com/g-truc/glm, which seems to include quite a few new fixes since the 0.9.9.8 release from 2020. I'm documenting the steps I took here for anyone else who is struggling because GLM's glmConfig.cmake
keeps moving around. (#402)
These steps are Windows and MinGW specific, because that is how I troubleshooted and tested these steps, but I expect them to apply to other platforms as well with minor changes. (Specifically, by dropping the -G "MinGW Makefiles"
in cmake arguments and changing e.g. set "var=path"
to export var="path"
in the globjects build steps.)
These steps worked for me as of the current latest GLM commit: g-truc/glm@47585fd
In these example steps, each git repository was cloned into E:/git
. In the steps for downloading and building globjects, change E:/git
to wherever you have downloaded and built each dependency.
First, download and build glbinding. In this example I am building latest master for the sake of simplicity, but generally you may want to use a tagged release, e.g. v3.3.0
.
git clone https://github.com/cginternals/glbinding
cd glbinding
cmake -S . -B build -G "MinGW Makefiles"
cmake --build build --config Release
Then, setup GLM. It is apparently necessary to build it and then, what was very surprising to me, to install in the build directory. Unfortunately the repository's documentation does not seem to have been updated to reflect this, at least not that I could find:
git clone https://github.com/g-truc/glm
cd glm
cmake -S . -B build -G "MinGW Makefiles"
cmake --build build
cmake --install build --prefix build
Finally, download and build globjects.
git clone https://github.com/cginternals/globjects
cd globjects
set "glbinding_DIR=E:/git/glbinding"
set "glm_DIR=E:/git/glm/build/lib/cmake/glm"
cmake -S . -B build -G "MinGW Makefiles"
cmake --build build