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

Mike Jackson mike.jackson at bluequartz.net
Thu Aug 28 15:07:34 EDT 2008



On Aug 28, 2008, at 3:00 PM, Fernando Cacciola wrote:

> Mike Jackson wrote:
>> Which version of Qt are you using? Qt 4.x is only officially  
>> supported on the native window system (Quartz/Carbon) NOT X11. Qt  
>> 3.x _may_ run under X11 on OS X so I don't know.
> We still use Qt 3.x as a matter of fact.
>
>> If some one new to OS X just did a locate on gl.h  then they may  
>> have found the wrong gl.h, or they really are running your project  
>> as an X11 application (non native window environment on OS X).
> Our users will run whatever Qt is generating.. it could be an X11  
> app in the case of Qt 3.x, I don't know.
>
> Btw, my user reported that "OpenGl/gl.h" does in fact compile,
> so it seems we'll fix it at the header file side via an __APPLE__  
> guard.
>
> Best
>
> Fernando
>

I _think_ Qt 3.x was ONLY X11 so that does make sense your users are  
seeing this. The issue with the FindOpenGL.cmake on OS X is that CMake  
will search for Frameworks _first_ then look elsewhere. By searching  
the Frameworks first CMake will find OpenGL.framework which isn't what  
you really (but in reality will be what you end up linking against..).  
You may want to take the FindOpenGL.cmake from the cmake distribution  
and tweak it to find the X11 version of OpenGL instead. If your  
project is going to stay with Qt3 this may be the advisable thing to do.

Cheers

----------------------------------------
Mike Jackson - BlueQuartz Software Consulting
<www.bluequartz.net>
mike.jackson at bluequartz.net




More information about the CMake mailing list