MantisBT - CMake
View Issue Details
0013746CMakeModulespublic2012-11-27 06:322013-10-07 10:09
hades 
Rolf Eike Beer 
normalminoralways
closedfixed 
Linux
CMake 2.8.9 
CMake 2.8.11 
0013746: FindOpenGL module reports OpenGL_FOUND even when no OPENGL_INCLUDE_DIR is set
When cmake can find a libGL.so, but no gl.h, it still sets OPENGL_FOUND to TRUE, despite that OPENGL_INCLUDE_DIR is set to NOTFOUND and therefore completely unusable.

I believe line 153 should be changed from:

FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenGL DEFAULT_MSG OPENGL_gl_LIBRARY)

to:

FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenGL DEFAULT_MSG OPENGL_gl_LIBRARY OPENGL_INCLUDE_DIR)
No tags attached.
Issue History
2012-11-27 06:32hadesNew Issue
2012-11-27 08:19Brad KingAssigned To => Brad King
2012-11-27 08:19Brad KingStatusnew => assigned
2012-11-27 08:19Brad KingNote Added: 0031722
2012-11-27 08:33Brad KingNote Added: 0031723
2012-11-27 08:33Brad KingStatusassigned => resolved
2012-11-27 08:33Brad KingResolutionopen => fixed
2012-11-27 08:33Brad KingFixed in Version => CMake 2.8.11
2012-11-27 08:33Brad KingTarget Version => CMake 2.8.11
2012-11-27 11:00Rolf Eike BeerNote Added: 0031729
2012-11-27 11:00Rolf Eike BeerStatusresolved => feedback
2012-11-27 11:00Rolf Eike BeerResolutionfixed => reopened
2012-11-27 11:14Brad KingNote Added: 0031730
2012-11-27 11:14Brad KingAssigned ToBrad King => Rolf Eike Beer
2012-11-27 11:14Brad KingStatusfeedback => assigned
2012-11-27 11:14Brad KingResolutionreopened => open
2012-11-27 11:14Brad KingFixed in VersionCMake 2.8.11 =>
2013-04-17 07:10Rolf Eike BeerNote Added: 0032856
2013-04-17 07:10Rolf Eike BeerStatusassigned => resolved
2013-04-17 07:10Rolf Eike BeerResolutionopen => fixed
2013-10-07 10:09Robert MaynardNote Added: 0034034
2013-10-07 10:09Robert MaynardStatusresolved => closed

Notes
(0031722)
Brad King   
2012-11-27 08:19   
The line in question was introduced here:

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

However, that commit only preserved existing behavior. It looks like the module has *never* considered OPENGL_INCLUDE_DIR to be required for FOUND!
(0031723)
Brad King   
2012-11-27 08:33   
Fixed:

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4960e918 [^]
(0031729)
Rolf Eike Beer   
2012-11-27 11:00   
I don't think this will be right. Now you will always get a failure on WIN32 && !CYGWIN, because it there doesn't even try to find the header.

And the whole CYGWIN stuff will probably also never work because the CYGWIN check is inside the WIN32 check, which is only defined if the compat policy is in place IIRC.
(0031730)
Brad King   
2012-11-27 11:14   
Thanks Eike. Reverted for now:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=69f962b1 [^]
(0032856)
Rolf Eike Beer   
2013-04-17 07:10   
Fix pushed to next, please test:

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5be35935dceb55923b954ef683aea02af6a92c86 [^]
(0034034)
Robert Maynard   
2013-10-07 10:09   
Closing resolved issues that have not been updated in more than 4 months.