Menu

#6 FindGLEW.cmake – wrong include path?

open
nobody
None
5
2008-07-09
2008-07-09
Anonymous
No

You recently changed the FindGLEW.cmake module to add the "gl" suffix to the include path. I believe this is not correct.

On non-Win32 platforms you are determing the include path like this:

FIND_PATH( GLEW_INCLUDE_DIR glew.h wglew.h
PATHS /usr/local/include /usr/include
PATH_SUFFIXES gl/ GL/ )

... which will typically end up in something like /usr/local/include/GL.

However, glew.h should be (and usually is) included as

#include <GL/glew.h>

and not as

#include <glew.h>

So with the include path returned now, the header won't be found.

I guess you had a good reason to change the macro, but perhaps that reason only applies to one specific platform, not all non-Win32 platforms?

At least for me on Mac OS X, the correct way of handling this is to not use the PATH_SUFFIXES option, i.e. have what you had before:

FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h GL/wglew.h
PATHS /usr/local/include /usr/include )

Bestest,

Karin Kosina (vka kyrah)
kyrah@kyrah.net

Discussion


Log in to post a comment.