victorprad / InfiniTAM

A Framework for the Volumetric Integration of Depth Images
http://www.infinitam.org
Other
918 stars 351 forks source link

CMake error for OpenGL while installing OpenCV on Ubuntu #53

Closed saigowri closed 6 years ago

saigowri commented 7 years ago

The following statements are added to the CMakeLists.txt file - find_package(GLUT REQUIRED) find_package(OpenGL REQUIRED) where do i add ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ? I read somewhere that they must be placed in the related target link libraries. Where exactly is that?

sgolodetz commented 7 years ago

@saigowri: On the off-chance that you haven't solved the problem since opening the issue, here's a link that should help:

https://cmake.org/cmake/help/v3.3/command/target_link_libraries.html

Basically, if you want to link the OpenGL and GLUT libraries into your application, which for the sake of argument we'll call Foo, then you add this to your CMakeLists.txt:

TARGET_LINK_LIBRARIES(Foo ${OPENGL_LIBRARIES} ${GLUT_LIBRARY})