jasper/jasper-freeglut.patch
2019-10-04 07:36:36 -05:00

67 lines
2.6 KiB
Diff

--- src/appl/jiv.c~ 2019-03-12 13:04:35.000000000 -0500
+++ src/appl/jiv.c 2019-09-18 14:49:59.512771783 -0500
@@ -68,7 +68,7 @@
#include <math.h>
#include <inttypes.h>
#if defined(JAS_HAVE_GL_GLUT_H)
-#include <GL/glut.h>
+#include <GL/freeglut.h>
#else
#include <glut.h>
#endif
--- CMakeLists.txt~ 2019-09-18 14:56:45.000000000 -0500
+++ CMakeLists.txt 2019-09-18 14:59:20.648018137 -0500
@@ -274,21 +274,21 @@
set(JAS_HAVE_OPENGL 0)
message("OpenGL include directory: ${OPENGL_INCLUDE_DIR}")
message("OpenGL libraries: ${OPENGL_LIBRARIES}")
- find_package(GLUT ${JAS_REQUIRED})
- message("GLUT library found: ${GLUT_FOUND}")
- if (GLUT_FOUND)
- message("GLUT include directory: ${GLUT_INCLUDE_DIR}")
- message("GLUT libraries: ${GLUT_LIBRARIES}")
- set(CMAKE_REQUIRED_INCLUDES ${GLUT_INCLUDE_DIR})
- check_include_files(GL/glut.h JAS_HAVE_GL_GLUT_H)
+ find_package(FreeGLUT ${JAS_REQUIRED})
+ message("GLUT library found: ${FreeGLUT_FOUND}")
+ if (FreeGLUT_FOUND)
+ message("GLUT include directory: ${FreeGLUT_INCLUDE_DIR}")
+ message("GLUT libraries: ${FreeGLUT_LIBRARIES}")
+ set(CMAKE_REQUIRED_INCLUDES ${FreeGLUT_INCLUDE_DIR})
+ check_include_files(GL/freeglut.h JAS_HAVE_GL_GLUT_H)
check_include_files(glut.h JAS_HAVE_GLUT_H)
message("JAS_HAVE_GLUT_H: ${JAS_HAVE_GLUT_H}")
message("JAS_HAVE_GL_GLUT_H: ${JAS_HAVE_GL_GLUT_H}")
if (JAS_HAVE_GL_GLUT_H OR JAS_HAVE_GLUT_H)
set(JAS_HAVE_OPENGL 1)
- include_directories(${GLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR})
+ include_directories(${FreeGLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR})
else()
- message(WARNING "The header files GL/glut.h and glut.h both appear to be missing.")
+ message(WARNING "The header files GL/freeglut.h and glut.h both appear to be missing.")
message(WARNING "Disabling OpenGL.")
endif()
endif()
@@ -312,7 +312,7 @@
set(JAS_HAVE_OPENGL 0)
set(OPENGL_INCLUDE_DIR "")
set(OPENGL_LIBRARIES "")
- set(GLUT_INCLUDE_DIR "")
+ set(FreeGLUT_INCLUDE_DIR "")
set(GLUT_LIBRARIES "")
endif()
message("JAS_HAVE_OPENGL: ${JAS_HAVE_OPENGL}")
--- src/appl/CMakeLists.txt~ 2019-03-12 13:04:35.000000000 -0500
+++ src/appl/CMakeLists.txt 2019-09-23 08:42:35.326681243 -0500
@@ -23,8 +23,8 @@
if(JAS_HAVE_OPENGL)
add_executable(jiv jiv.c)
target_include_directories(jiv PUBLIC
- ${GLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR})
- target_link_libraries(jiv libjasper ${JPEG_LIBRARIES} ${GLUT_LIBRARIES}
+ ${FreeGLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR})
+ target_link_libraries(jiv libjasper ${JPEG_LIBRARIES} -lglut
${OPENGL_LIBRARIES} ${MATH_LIBRARY})
set(programs "${programs}" jiv)
set(man_pages "${man_pages}" jiv.1)