[CMake] OpenGL on Mac OS X
Chris Scharver
scharver at evl.uic.edu
Tue Mar 1 09:47:21 EST 2005
On Mar 1, 2005, at 12:38 AM, Won-Ki Jeong wrote:
> Hi... I am a newbie in Mac OS X, and trying to compile openGL program
> using cmake. I use cmake ver 2.0.5. When I generate Makefile using
> cmake, it picks up -lGL instead of -framework OpenGL, etc. It seems
> that FindOpenGL.cmake is also correct but it alwas links to X11
> openGL. How can I fix this?
What other CMake modules are you using? Are you linking against
${OPENGL_gl_LIBRARY} or ${OPENGL_LIBRARIES}? I know that one point,
CMake searched for and located X11 headers and libraries if they were
present, regardless of whether they were needed. The result of this was
that if you have the X11 libraries installed, they were linked if you
requested OpenGL. My work-around involved creating my own
FindOpenGL.cmake that only grabs libraries if X11 is being targeted. I
actually haven't gone back to the default FindOpenGL module yet. ;)
I think this was fixed in CMake a while ago:
<http://public.kitware.com/pipermail/cmake/2004-April/004916.html>
Mac OS X makes things tricky since it provides several windowing APIs.
Ideally, CMake could be set to target a certain API, thus building X11
or native variants. Such a feature wouldn't be trivial to implement,
however. ;)
Chris
--
Chris Scharver
Electronic Visualization Laboratory
The University of Illinois at Chicago
More information about the CMake
mailing list