FindGLUT.cmake: Failing to link statically compile glut on windows with mingw-w64
Related MR for libtiff: https://gitlab.com/libtiff/libtiff/-/merge_requests/233
FreeGLUT compiled from https://github.com/dcnieho/FreeGLUT with mingw-w64 gcc provided by msys2 and the FREEGLUT_REPLACE_GLUT
option set to ON and FREEGLUT_BUILD_SHARED_LIBS
to OFF provides libglut.a
, GL/glut.h
, pkgconfig/glut.pc
and a few other FreeGLUT related files.
Attempting to use the FindGLUT.cmake module and linking GLUT::GLUT
results in undefined references to winmm and opengl32 library functions as GLUT::GLUT
does not properly list them as dependencies.
It would probably be preferred to check pkg-config if glut exists and try pulling information from there before checking for the physical files.
glut.pc:
prefix=D:/media-autobuild_suite/local64
libdir=D:/media-autobuild_suite/local64/lib
includedir=${prefix}/include
Name: glut
Description: A freely licensed and improved alternative to the GLUT library
Version: 3.2.1
Libs: -L${libdir} -lglut
Libs.private: -lopengl32 -lwinmm -lgdi32 -lm
Cflags: -I${includedir} -DFREEGLUT_STATIC