[CMake] Why is FindOpenGL in Mac looking for OpenGL/gl.h??

Mike Jackson mike.jackson at bluequartz.net
Thu Aug 28 08:30:15 EDT 2008


The header is located in a framework called OpenGL.framework and the include
style for frameworks is the name of the framework (minus the extension) and
then the header file, so on OS X the proper include would be:
#include <OpenGL/gl.h>

Sometimes having your own "OpenGL.h" header with the following can help to
alleviate these problems:

#ifdef __APPLE__
# include <OpenGL/gl.h>
#else
# ifdef _MSC_VER
#  define NOMINMAX
#  include <windows.h>
# endif
# include <GL/gl.h>
#endif

Mike Jackson
www.bluequartz.net

On Thu, Aug 28, 2008 at 7:54 AM, Fernando Cacciola <
fernando.cacciola at gmail.com> wrote:

> Hi there,
>
> While I am not a mac user myself, users reported to me that at
> least in Tiger and Leopard, gl.h is located in directory GL
> (as in any other *NIX), not directory OpenGL.
>
> Is this a bug in the module? Or are there OS X systems out there where gl.h
> is located under OpenGL?
>
> TIA
>
> Fernando Cacciola
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080828/bf1817a2/attachment-0001.htm>


More information about the CMake mailing list