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

Fernando Cacciola fernando.cacciola at gmail.com
Thu Aug 28 09:48:11 EDT 2008


Mike Jackson wrote:
> /System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/gl.h
> 
> That is the path on both Tiger and Leopard. Don't know what to tell you. 
> It has been like this for at least 10.3 on up. I am not sure how they 
> are getting away with GL/gl.h ... WAIT... Is this an X11 Application?
> 
I'm totally Mac agnostic, but I think it is.
The project is a library and uses Qt for graphical output, so I guess 
that means it is an X11 library not only on UNIX/Linux but on Mac as well.

> In that case I think the include path would be:
> 
> /usr/X11/include/GL/gl.h
> 
> which explains this..
> 
> Is that correct for your situation?
> 
 >
Apparently, yes.
My user reported that "locate gl.h" shows up precisely that path.

I'm not sure what does that mean though. Should FindOpenGL.cmake search 
for both cases and define a compile flag telling which path prefix to use?

TIA

Fernando Cacciola














> ----------------------------------------
> Mike Jackson - BlueQuartz Software Consulting
> <www.bluequartz.net>
> mike.jackson at bluequartz.net
> 
> 
> 
> On Aug 28, 2008, at 8:42 AM, Fernando Cacciola wrote:
> 
>> Mike Jackson wrote:
>>> 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>
>> But do you know for a fact that it is like so in the particular case 
>> of gl.h??
>>
>> I'm porting the existing and fully working custom build system of a 
>> large project to cmake.
>> This project headers are (and have been for a long time) including 
>> <GL/gl.h> *even* on the Mac, and the current build system is searching 
>> for gl.h under GL, even for the Mac as well.
>>
>>
>>> Sometimes having your own "OpenGL.h" header with the following can 
>>> help to
>>> alleviate these problems:
>> This is exactly what I suggested, but the users responded that gl.h IS 
>> NOT under OpenGL but under GL.
>>
>> In fact, they even asked me why on earth is cmake looking for it under 
>> OpenGL instead of GL?
>>
>>
>> Keep in mind that this is a working project which builds and run 
>> correctly via the old shell-based build system.. it is my cmake port 
>> wich fails.
>>
>> Best
>>
>> Fernando Cacciola
>>
>>
>> _______________________________________________
>> CMake mailing list
>> CMake at cmake.org
>> http://www.cmake.org/mailman/listinfo/cmake



More information about the CMake mailing list