openglsuperbible / sb7code

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

tweak to CMakeLists.txt for Fedora 27 #33

Open bengland2 opened 6 years ago

bengland2 commented 6 years ago

This is what I did to get this repo to build on Fedora 27:

$ git diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 580758a..2b8d9d0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,7 +25,7 @@ set(COMMON_LIBS sb7 optimized glfw3 debug glfw3_d ${GLFW_LIBRARIES} ${OPENGL_LIB
 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)
+set(COMMON_LIBS sb7 glfw X11 Xrandr Xinerama Xi Xxf86vm Xcursor GL rt dl)
 else()
 set(COMMON_LIBS sb7)
 endif()

am running with glfw-3.2.1-6.fc27.x86_64 RPM. Is this supported? I am seeing some segfaults in some of the example programs. Thx again for the book.

mattgruenke commented 6 years ago

There's a slightly better & more portable fix for this, in Pull Request #13.

I recommend cloning the repo and merging in Pull Request's #5 and #7, as well.

mattgruenke commented 6 years ago

You might also have a look at these changes:

https://github.com/mattgruenke/sb7plus/commit/354c6ca9e56f212417f40750296e90d2479fbe4c#diff-af3b638bc2a3e6c650974192a53c7291

https://github.com/mattgruenke/sb7plus/commit/2be36a5d0aa7af4cd66a8a22ae57f28b3480aa2e#diff-af3b638bc2a3e6c650974192a53c7291

https://github.com/mattgruenke/sb7plus/commit/420c5d86bb0ab84a8d9da014663eedf40722636f#diff-af3b638bc2a3e6c650974192a53c7291

If anyone were actively merging in PRs, I'd do some cleanup and submit them. My goal was basically to make CMake behave in a more typical fashion and exclude the bundled version of glfw. On that point, note that I initially fixed glfw the same way as you did.

RemusRomulus commented 5 years ago

I had to do this exact same thing for CentOS7, see issue #37.