Murat Aykanat
Murat Aykanat

Reputation: 1708

How to build the C++ GLM library with cmake in Windows?

I am having issues building the GLM library. I am using Windows and VS Code. I have the following installed:

For GLM, as instructed in their readme:

I tried with cmake-gui as well but I got the same error when I clicked configure.

I also have the cmake extension for VS Code so I tried configuring and building in VS Code, right clicking on the CmakeLists.txt and selecting "Clean Reconfigure All Projects". That resolved the compiler related errors:

[cmake] -- Check for working C compiler: C:/mingw64/bin/gcc.exe - skipped
[cmake] -- Check for working CXX compiler: C:/mingw64/bin/g++.exe - skipped

And I also didn't get the no such file or directory error. However, when I tried to continue with the rest of the instructions, at the C:\cmake\bin\cmake --build build -- install command, I got the mingw32-make: *** No rule to make target 'install'. Stop. error.

I see that there are two cmakes (cmake.exe and mingw32-make) and I was thinking that may be causing issues but I haven't found how I can fix that issue.

Upvotes: 0

Views: 114

Answers (1)

Murat Aykanat
Murat Aykanat

Reputation: 1708

I want to provide what I did to solve this per the comments of @Tsyvarev and @drescherjm

I downloaded the actual source from the GLM releases page

After unzipping the source, at the root of the source, I ran the commands:

C:\cmake\bin\cmake -DGLM_BUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF -B build . -G "MinGW Makefiles"
C:\cmake\bin\cmake --build build -- all
C:\cmake\bin\cmake --build build -- install

Adding "MinGW Makefiles" resolved the "compiler variable not set" errors I was getting and since the source contained the GLM_BUILD_INSTALL, the install executed without errors.

Upvotes: 0

Related Questions