openglsuperbible / sb7code

Source code and supporting material for the 7th Edition of OpenGL SuperBible
720 stars 250 forks source link

Hardcoded glfw3 in cmake #17

Open wieczyk opened 8 years ago

wieczyk commented 8 years ago

On my operating system the name of a glfw library is libglfw.so.3, not libglfw3.so*.

It looks like the glfw3 string is hardcoded into CMakeLists.txt:

pkg_check_modules(GLFW REQUIRED glfw3)
set(COMMON_LIBS sb7 glfw3 X11 Xrandr Xinerama Xi Xxf86vm Xcursor GL rt dl)

When I replaced glfw3 by the ${GLFW_LIBRARIES} it started to work.

set(COMMON_LIBS sb7 ${GLFW_LIBRARIES} X11 Xrandr Xinerama Xi Xxf86vm Xcursor GL rt dl)

Could you add this change into repository?

mpredosin commented 7 years ago

The following change worked for me:

diff --git a/CMakeLists.txt b/CMakeLists.txt index 580758a..aa8100f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,8 +24,8 @@ if(WIN32) set(COMMON_LIBS sb7 optimized glfw3 debug glfw3_d ${GLFW_LIBRARIES} ${OPENGL_LIBRARIES}) elseif (UNIX) find_package(PkgConfig REQUIRED) -pkg_check_modules(GLFW REQUIRED glfw3) -set(COMMON_LIBS sb7 glfw3 X11 Xrandr Xinerama Xi Xxf86vm Xcursor GL rt dl) +pkg_check_modules(GLFW REQUIRED glfw) +set(COMMON_LIBS sb7 glfw X11 Xrandr Xinerama Xi Xxf86vm Xcursor GL rt dl) else() set(COMMON_LIBS sb7) endif()

twilson271828 commented 6 years ago

@wieczyk That solution worked for me as well.