Eyescale/CMake

MinGW: FindGLEW_MX.cmake does not find libglew32mx.dll.a

seifertm opened this issue · 1 comments

When building GLEW with MinGW, the GLEWmx library is not found by FindGLEW_MX.cmake.

The build instructions for GLEW [1] suggest to set the SYSTEM variable when calling make. One of the possible values is mingw, where the library base name is glew32 [2]. This causes the multi context library to be built under the name libglew32mx.dll.a which is not found by the CMake module.

I suggest adding a library name to FindGLEW_MX.cmake like so:

diff --git a/FindGLEW_MX.cmake b/FindGLEW_MX.cmake
index 19e3a58..31aaa50 100644
--- a/FindGLEW_MX.cmake
+++ b/FindGLEW_MX.cmake
@@ -11,7 +11,7 @@ find_path(_glew_mx_INCLUDE_DIR GL/glew.h
   /usr/include /usr/local/include /opt/local/include)

 find_library(_glew_mx_LIBRARY
-  NAMES GLEWmx GLEW glew glew32
+  NAMES GLEWmx glew32mx GLEW glew glew32
   PATHS /usr/lib /usr/local/lib)

 if(_glew_mx_INCLUDE_DIR AND _glew_mx_LIBRARY)

For the time being, I created the link libGLEWmx.dll.a which points to libglew32mx.dll.a as a workaround.

Cheers,
Michael

[1] http://glew.sourceforge.net/build.html
[2] http://sourceforge.net/p/glew/code/ci/glew-1.10.0/tree/config/Makefile.mingw

eile commented

See #194. Please submit a PR directly next time.