Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building globjects with GLM 0.9.9.9 #409

Open
pineapplemachine opened this issue Oct 11, 2023 · 1 comment
Open

Building globjects with GLM 0.9.9.9 #409

pineapplemachine opened this issue Oct 11, 2023 · 1 comment

Comments

@pineapplemachine
Copy link

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
@scheibel
Copy link
Member

scheibel commented Nov 5, 2023

Thanks for investigating.

I can confirm that the setup for the glmConfig.cmake changed and the following paths works for glm 0.9.9.9:

CMAKE_PREFIX_PATH="<glm_install_root>/"
CMAKE_PREFIX_PATH="<glm_install_root>/.." (if installed in a directory called "glm")
CMAKE_PREFIX_PATH="<glm_install_root>/lib/cmake"
CMAKE_PREFIX_PATH="<glm_install_root>/lib/cmake/glm"

glm_DIR="<glm_install_root>/"
glm_DIR="<glm_install_root>/.." (if installed in a directory called "glm")
glm_DIR="<glm_install_root>/lib/cmake"
glm_DIR="<glm_install_root>/lib/cmake/glm"

To make this test complete, the following paths work for glm 0.9.9.8 and below:

CMAKE_PREFIX_PATH="<glm_source_root>/cmake"
CMAKE_PREFIX_PATH="<glm_source_root>/cmake/glm"

glm_DIR="<glm_source_root>/cmake"
glm_DIR="<glm_source_root>/cmake/glm"

Unfortunately, those path setups are not compatible, i.e., there is no common setup for either CMAKE_PREFIX_PATH or glm_DIR that accommodates for both versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants