View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014060CMakeModulespublic2013-04-04 08:162016-06-10 14:31
ReporterMarcel Loose 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformLinuxOSUbuntuOS Version12.10
Product VersionCMake 2.8.10.2 
Target VersionFixed in Version 
Summary0014060: FindGLUT puts NOTFOUND in GLUT_LIBRARIES
DescriptionFindGLUT puts GLUT_Xmu_LIBRARY-NOTFOUND;GLUT_Xi_LIBRARY-NOTFOUND in the variable GLUT_LIBRARIES, when GLUT_FOUND is TRUE.

This causes CMake to bail out with the following error:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
GLUT_Xi_LIBRARY (ADVANCED)
    linked by target "foo" in directory /home/marcel/temp/cmake/findglut-bug
GLUT_Xmu_LIBRARY (ADVANCED)
    linked by target "foo" in directory /home/marcel/temp/cmake/findglut-bug
Steps To Reproduce1. Create a CMakeLists.txt file that contains the following:

cmake_minimum_required(VERSION 2.8)
project(FindGLUT_Bug C)
find_package(GLUT)
if(GLUT_FOUND)
  add_executable(foo foo.c)
  target_link_libraries(foo ${GLUT_LIBRARIES})
endif()

2. Create a (empty) file foo.c

3. Run cmake
Additional InformationThis bug is also present in cmake 2.8.9. Older versions of cmake (e.g. 2.8.0) set GLUT_FOUND to FALSE, which is probably also not what you'd want, because if I remove the NOTFOUND entries from GLUT_LIBRARIES, everything works fine.

Workaround:

set(_glut_libraries)
foreach(_lib ${GLUT_LIBRARIES})
  if(_lib)
    list(APPEND _glut_libraries ${_lib})
  endif()
endforeach()
set(GLUT_LIBRARIES ${_glut_libraries})
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0032855)
Rolf Eike Beer (developer)
2013-04-17 06:17

The current assumption of that module is that Xmu and Xi are needed by the GLUT lib on everything but Apple, BeOS, and Windows. Seems this is (no longer?) true. But I have no clue if it had been true, or is true on some platforms. That should be decided by someone who has a clue about GLUT at all. So the simple fix would be to only add those libs if they are found, but that would risk breaking something else.
(0032858)
Marcel Loose (developer)
2013-04-17 08:51

Well, I'm definitely not a GLUT expert either. But I think I narrowed down the probable cause. In line 26, "freeglut" was added somewhere between cmake 2.8.3 and 2.8.6.

It appears that (at least on Ubuntu Linux) you only need libglut.so, but that also depends on libX11. So, at least on Linux, FindGLUT should also do a find_package(X11).

I cannot judge for freeglut on other platforms.
(0038363)
Orion Poplawski (reporter)
2015-03-30 11:34

Fedora bug filed: https://bugzilla.redhat.com/show_bug.cgi?id=1207045 [^]

For properly linked shared libraries you should only need -lglut. For static, that's a different story.
(0042261)
Kitware Robot (administrator)
2016-06-10 14:28

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2013-04-04 08:16 Marcel Loose New Issue
2013-04-04 08:40 Brad King Assigned To => Rolf Eike Beer
2013-04-04 08:40 Brad King Status new => assigned
2013-04-17 06:17 Rolf Eike Beer Note Added: 0032855
2013-04-17 08:51 Marcel Loose Note Added: 0032858
2015-03-30 11:34 Orion Poplawski Note Added: 0038363
2016-02-25 13:07 Rolf Eike Beer Assigned To Rolf Eike Beer =>
2016-02-25 13:07 Rolf Eike Beer Status assigned => backlog
2016-06-10 14:28 Kitware Robot Note Added: 0042261
2016-06-10 14:28 Kitware Robot Status backlog => resolved
2016-06-10 14:28 Kitware Robot Resolution open => moved
2016-06-10 14:28 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team