[cmake-developers] [CMake 0014060]: FindGLUT puts NOTFOUND in GLUT_LIBRARIES
Mantis Bug Tracker
mantis at public.kitware.com
Thu Apr 4 08:16:16 EDT 2013
The following issue has been SUBMITTED.
======================================================================
http://public.kitware.com/Bug/view.php?id=14060
======================================================================
Reported By: Marcel Loose
Assigned To:
======================================================================
Project: CMake
Issue ID: 14060
Category: Modules
Reproducibility: always
Severity: minor
Priority: normal
Status: new
======================================================================
Date Submitted: 2013-04-04 08:16 EDT
Last Modified: 2013-04-04 08:16 EDT
======================================================================
Summary: FindGLUT puts NOTFOUND in GLUT_LIBRARIES
Description:
FindGLUT 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 Reproduce:
1. 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 Information:
This 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})
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2013-04-04 08:16 Marcel Loose New Issue
======================================================================
More information about the cmake-developers
mailing list