MantisBT - CMake
View Issue Details
0013050CMakeModulespublic2012-03-18 04:412012-09-03 16:00
Davide Barbieri 
Brad King 
normalminoralways
closedno change required 
X86Windows7
CMake 2.8.7 
 
0013050: FindOpenGL not working on Cygwin
find_package(OpenGL) is not working on cygwin with cmake 2.8.7.

Probably, because in the newer versions of cmake you don't define
WIN32 no more.
But you still use it for FindOpenGL.cmake:

IF (WIN32)
  IF (CYGWIN)
    FIND_PATH(OPENGL_INCLUDE_DIR GL/gl.h )
    FIND_LIBRARY(OPENGL_gl_LIBRARY opengl32 )
    FIND_LIBRARY(OPENGL_glu_LIBRARY glu32 )
  ELSE (CYGWIN)
...

using directly the find_library macro, it works..
find_package(OpenGL)
No tags attached.
related to 0010122closed Brad King Patches for Cygwin 
Issue History
2012-03-18 04:41Davide BarbieriNew Issue
2012-03-19 09:21Brad KingRelationship addedrelated to 0010122
2012-03-19 09:21Brad KingNote Added: 0028934
2012-03-19 09:23Brad KingNote Added: 0028935
2012-03-19 20:30Davide BarbieriNote Added: 0028939
2012-03-19 20:31Davide BarbieriNote Deleted: 0028939
2012-03-19 20:58Davide BarbieriNote Added: 0028940
2012-03-20 08:40Brad KingNote Added: 0028941
2012-03-20 08:40Brad KingStatusnew => resolved
2012-03-20 08:40Brad KingResolutionopen => no change required
2012-03-20 08:40Brad KingAssigned To => Brad King
2012-09-03 16:00David ColeNote Added: 0030838
2012-09-03 16:00David ColeStatusresolved => closed

Notes
(0028934)
Brad King   
2012-03-19 09:21   
This commit:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=85c0a69a [^]

removed the definition of WIN32 for issue 0010122.
(0028935)
Brad King   
2012-03-19 09:23   
The FindOpenGL code path in question is left from when Cygwin packages could use the Windows GL. Cygwin now always builds packages against the X11 GL libraries. Install that package and the else(WIN32)/else(APPLE) block will find them.
(0028940)
Davide Barbieri   
2012-03-19 20:58   
Ok, in fact I was using:
/usr/lib/w32api/libopengl32.a
(0028941)
Brad King   
2012-03-20 08:40   
Cygwin upstream has moved toward X11-only (the Tcl/Tk package switched recently IIUC). If you *do* want to use the Windows one then you can set CMAKE_LEGACY_CYGWIN_WIN32 to tell CMake to treat Cygwin like Windows which will define WIN32 and take the old code path in FindOpenGL. Otherwise just pass -DOPENGL_gl_LIBRARY=/usr/lib/w32api/libopengl32.a and other relevant options to tell CMake what GL to use.
(0030838)
David Cole   
2012-09-03 16:00   
Closing resolved issues that have not been updated in more than 4 months.