Description | FindGLUT.cmake's GLUT_INCLUDE_DIR is incorrect for MacOS X. The native GLUT library is built as a Cocoa framework. As such, searching for "GL/glut.h" is incorrect. The correct header is "GLUT/glut.h", but this isn't a path--it's a framework header. To keep variables present, I usually set include paths to locate the framework. In this case, I used:
FIND_PATH( GLUT_INCLUDE_DIR GLUT.framework
${OPENGL_INCLUDE_DIR}
/System/Library
)
This value is still technically incorrect, but it doesn't generate an error as happens when CMake cannot find GL/glut.h. A technically correct approach would require supporting frameworks and using -F rather than -I when setting the path. Perhaps a future enhancement could check the target name for a path to see if it ends with ".framework?" |