When I compile my old program with CMake I keep getting this message:
-- WARNING: you are using the obsolete 'GLU' package, please use 'OpenGL' instead
OK, so I tried to remove this form CMakeFiles
find_package( OpenGL REQUIRED )
#find_package( GLU REQUIRED )
find_package( SDL2 REQUIRED )
add_executable ( test_app test_app.cpp $<TARGET_OBJECTS:SDL2OGL> $<TARGET_OBJECTS:DynamicOpt> )
#target_link_libraries( test_app ${OpenGL_LIBRARY} ${GLU_LIBRARY} ${SDL2_LIBRARY} )
target_link_libraries( test_app ${OpenGL_LIBRARY} ${SDL2_LIBRARY} )
But then the legacy OpenGL functions are undefined?
undefined reference to `glTranslatef'
undefined reference to `glPopMatrix'
undefined reference to `glPushMatrix'
undefined reference to `glCallList'
undefined reference to `glColor3f'
undefined reference to `glDisable'
undefined reference to `glShadeModel'
...
So I don't know, what should I do to link it against OpenGL properly. Do I need GLU for legacy OpenGL or not?
EDIT:
aha so the whole problem was that I had OPENGL_LIBRARY instead of OPENGL_LIBRARIES, as pointed by Tsyvarev, Thanks!
In other words, It turned out, I was using GLU_LIBRARY just to replace missing OPENGL_LIBRARIES