summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJordan Williams <jordan@jwillikers.com>2024-04-12 08:58:57 -0500
committerGitHub <noreply@github.com>2024-04-12 15:58:57 +0200
commita6651e10ffc1753945faf8de0192cf74effc80d8 (patch)
tree591b96610879f3d44705864d243751592108c749 /src
parent5de880ae810f7790d888d52a1accbafb0607bf0f (diff)
CMake: Improve detection of the GLU library and GL/glu.h header file (#953)
* CMake: Improve detection of the GLU library and GL/glu.h header file Locate the GLU library and header independent of the GL library and header locations. Add the GLU header location to necessary target_include_directory calls. * CMake: Locate and use the GL include directory Find the GL include directory and use it in target_include_directories calls.
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 58954c2ca..b12880c3b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -813,6 +813,10 @@ endif()
if(FLTK_USE_GL)
fl_add_library(fltk_gl STATIC "${GLCPPFILES};${GL_HEADER_FILES};${GL_DRIVER_HEADER_FILES}")
target_link_libraries(fltk_gl PUBLIC ${OPENGL_LIBRARIES} fltk::fltk)
+ target_include_directories(fltk_gl PUBLIC ${OPENGL_INCLUDE_DIR} ${OPENGL_INCLUDE_DIRS})
+ if(OPENGL_GLU_INCLUDE_DIR)
+ target_include_directories(fltk_gl PUBLIC ${OPENGL_GLU_INCLUDE_DIR})
+ endif()
endif(FLTK_USE_GL)
#######################################################################
@@ -879,6 +883,10 @@ if(FLTK_BUILD_SHARED_LIBS AND NOT MSVC)
if(FLTK_USE_GL)
fl_add_library(fltk_gl SHARED "${GLCPPFILES};${GL_HEADER_FILES};${GL_DRIVER_HEADER_FILES}")
target_link_libraries(fltk_gl-shared PUBLIC ${OPENGL_LIBRARIES} fltk::fltk-shared)
+ target_include_directories(fltk_gl-shared PUBLIC ${OPENGL_INCLUDE_DIR} ${OPENGL_INCLUDE_DIRS})
+ if(OPENGL_GLU_INCLUDE_DIR)
+ target_include_directories(fltk_gl-shared PUBLIC ${OPENGL_GLU_INCLUDE_DIR})
+ endif()
endif(FLTK_USE_GL)
endif(FLTK_BUILD_SHARED_LIBS AND NOT MSVC)
@@ -918,6 +926,10 @@ if(FLTK_BUILD_SHARED_LIBS AND MSVC)
if(OPENGL_FOUND)
target_link_libraries(fltk-shared PUBLIC ${OPENGL_LIBRARIES})
+ target_include_directories(fltk_gl-shared PUBLIC ${OPENGL_INCLUDE_DIR} ${OPENGL_INCLUDE_DIRS})
+ if(OPENGL_GLU_INCLUDE_DIR)
+ target_include_directories(fltk-shared PUBLIC ${OPENGL_GLU_INCLUDE_DIR})
+ endif()
endif(OPENGL_FOUND)
endif(FLTK_BUILD_SHARED_LIBS AND MSVC)