Blame SOURCES/jasper-freeglut.patch

f4bd2b
diff -urNp a/build/cmake/modules/JasOpenGL.cmake b/build/cmake/modules/JasOpenGL.cmake
f4bd2b
--- a/build/cmake/modules/JasOpenGL.cmake	2020-10-07 10:00:16.316291325 +0200
f4bd2b
+++ b/build/cmake/modules/JasOpenGL.cmake	2020-10-07 10:03:39.536143003 +0200
f4bd2b
@@ -13,19 +13,19 @@ if (JAS_ENABLE_OPENGL AND OPENGL_FOUND)
f4bd2b
 	set(JAS_HAVE_OPENGL 0)
f4bd2b
 	message("OpenGL include directory: ${OPENGL_INCLUDE_DIR}")
f4bd2b
 	message("OpenGL libraries: ${OPENGL_LIBRARIES}")
f4bd2b
-	find_package(GLUT ${JAS_REQUIRED})
f4bd2b
-	message("GLUT library found: ${GLUT_FOUND}")
f4bd2b
-	if (GLUT_FOUND)
f4bd2b
-		message("GLUT include directory: ${GLUT_INCLUDE_DIR}")
f4bd2b
-		message("GLUT libraries: ${GLUT_LIBRARIES}")
f4bd2b
-		set(CMAKE_REQUIRED_INCLUDES ${GLUT_INCLUDE_DIR})
f4bd2b
-		check_include_files(GL/glut.h JAS_HAVE_GL_GLUT_H)
f4bd2b
+	find_package(FreeGLUT ${JAS_REQUIRED})
f4bd2b
+	message("GLUT library found: ${FreeGLUT_FOUND}")
f4bd2b
+	if (FreeGLUT_FOUND)
f4bd2b
+		message("GLUT include directory: ${FreeGLUT_INCLUDE_DIR}")
f4bd2b
+		message("GLUT libraries: ${FreeGLUT_LIBRARIES}")
f4bd2b
+		set(CMAKE_REQUIRED_INCLUDES ${FreeGLUT_INCLUDE_DIR})
f4bd2b
+		check_include_files(GL/freeglut.h JAS_HAVE_GL_GLUT_H)
f4bd2b
 		check_include_files(glut.h JAS_HAVE_GLUT_H)
f4bd2b
 		if (JAS_HAVE_GL_GLUT_H OR JAS_HAVE_GLUT_H)
f4bd2b
 			set(JAS_HAVE_OPENGL 1)
f4bd2b
-			include_directories(${GLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR})
f4bd2b
+			include_directories(${FreeGLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR})
f4bd2b
 		else()
f4bd2b
-			message(WARNING "The header files GL/glut.h and glut.h both appear to be missing.")
f4bd2b
+			message(WARNING "The header files GL/freeglut.h and glut.h both appear to be missing.")
f4bd2b
 			message(WARNING "Disabling OpenGL.")
f4bd2b
 		endif()
f4bd2b
 	endif()
f4bd2b
@@ -49,6 +49,6 @@ else()
f4bd2b
 	set(JAS_HAVE_OPENGL 0)
f4bd2b
 	set(OPENGL_INCLUDE_DIR "")
f4bd2b
 	set(OPENGL_LIBRARIES "")
f4bd2b
-	set(GLUT_INCLUDE_DIR "")
f4bd2b
+	set(FreeGLUT_INCLUDE_DIR "")
f4bd2b
 	set(GLUT_LIBRARIES "")
f4bd2b
 endif()
f4bd2b
diff -urNp a/src/appl/CMakeLists.txt b/src/appl/CMakeLists.txt
f4bd2b
--- a/src/appl/CMakeLists.txt	2020-10-07 10:00:16.338291526 +0200
f4bd2b
+++ b/src/appl/CMakeLists.txt	2020-10-07 10:04:58.864872143 +0200
f4bd2b
@@ -23,8 +23,8 @@ set(man_pages "${man_pages}" imgcmp.1)
f4bd2b
 if(JAS_HAVE_OPENGL)
f4bd2b
 	add_executable(jiv jiv.c)
f4bd2b
 	target_include_directories(jiv PUBLIC
f4bd2b
-	  ${GLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR})
f4bd2b
-	target_link_libraries(jiv libjasper ${JPEG_LIBRARIES} ${GLUT_LIBRARIES}
f4bd2b
+	  ${FreeGLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR})
f4bd2b
+	target_link_libraries(jiv libjasper ${JPEG_LIBRARIES} -lglut
f4bd2b
 	  ${OPENGL_LIBRARIES} ${MATH_LIBRARY})
f4bd2b
 	set(programs "${programs}" jiv)
f4bd2b
 	set(man_pages "${man_pages}" jiv.1)
f4bd2b
diff -urNp a/src/appl/jiv.c b/src/appl/jiv.c
f4bd2b
--- a/src/appl/jiv.c	2020-10-07 10:00:16.340291544 +0200
f4bd2b
+++ b/src/appl/jiv.c	2020-10-07 10:05:35.319207658 +0200
f4bd2b
@@ -68,7 +68,7 @@
f4bd2b
 #include <math.h>
f4bd2b
 #include <inttypes.h>
f4bd2b
 #if defined(JAS_HAVE_GL_GLUT_H)
f4bd2b
-#include <GL/glut.h>
f4bd2b
+#include <GL/freeglut.h>
f4bd2b
 #else
f4bd2b
 #include <glut.h>
f4bd2b
 #endif