diff options
author | Lukas Rusak <lorusak@gmail.com> | 2021-10-10 21:22:16 -0700 |
---|---|---|
committer | Lukas Rusak <lorusak@gmail.com> | 2021-10-18 19:57:54 -0700 |
commit | 650a701f0cc356ff0becb42bad9d61de3ecf08dd (patch) | |
tree | 77d5e55ac79665f7557b1a8196efe86f9b83c24d /cmake/modules | |
parent | 921382ea58ca0bae1789d35a7575dd07544c1108 (diff) |
[cmake] split glu dependency into it's own module
Diffstat (limited to 'cmake/modules')
-rw-r--r-- | cmake/modules/FindGLU.cmake | 33 | ||||
-rw-r--r-- | cmake/modules/FindOpenGl.cmake | 11 |
2 files changed, 37 insertions, 7 deletions
diff --git a/cmake/modules/FindGLU.cmake b/cmake/modules/FindGLU.cmake new file mode 100644 index 0000000000..f91d33deb6 --- /dev/null +++ b/cmake/modules/FindGLU.cmake @@ -0,0 +1,33 @@ +#.rst: +# FindGLU +# ----- +# Finds the GLU library +# +# This will define the following variables:: +# +# GLU_FOUND - system has GLU +# GLU_INCLUDE_DIRS - the GLU include directory +# GLU_LIBRARIES - the GLU libraries +# GLU_DEFINITIONS - the GLU definitions +# + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_GLU glu QUIET) +endif() + +find_path(GLU_INCLUDE_DIR NAMES GL/glu.h + PATHS ${PC_GLU_INCLUDEDIR}) +find_library(GLU_LIBRARY NAMES GLU + PATHS ${PC_GLU_LIBDIR}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GLU + REQUIRED_VARS GLU_LIBRARY GLU_INCLUDE_DIR) + +if(GLU_FOUND) + set(GLU_LIBRARIES ${GLU_LIBRARY}) + set(GLU_INCLUDE_DIRS ${GLU_INCLUDE_DIR}) + set(GLU_DEFINITIONS -DHAS_GLU=1) +endif() + +mark_as_advanced(GLU_INCLUDE_DIR GLU_LIBRARY) diff --git a/cmake/modules/FindOpenGl.cmake b/cmake/modules/FindOpenGl.cmake index cb695a6c6f..e155cda520 100644 --- a/cmake/modules/FindOpenGl.cmake +++ b/cmake/modules/FindOpenGl.cmake @@ -11,7 +11,7 @@ # OPENGL_DEFINITIONS - the OpenGl definitions if(PKG_CONFIG_FOUND) - pkg_check_modules(PC_OPENGL gl glu QUIET) + pkg_check_modules(PC_OPENGL gl QUIET) endif() if(NOT CORE_SYSTEM_NAME STREQUAL osx) @@ -19,25 +19,22 @@ if(NOT CORE_SYSTEM_NAME STREQUAL osx) PATHS ${PC_OPENGL_gl_INCLUDEDIR}) find_library(OPENGL_gl_LIBRARY NAMES GL PATHS ${PC_OPENGL_gl_LIBDIR}) - find_library(OPENGL_glu_LIBRARY NAMES GLU - PATHS ${PC_OPENGL_glu_LIBDIR}) else() find_library(OPENGL_gl_LIBRARY NAMES OpenGL PATHS ${CMAKE_OSX_SYSROOT}/System/Library PATH_SUFFIXES Frameworks NO_DEFAULT_PATH) set(OPENGL_INCLUDE_DIR ${OPENGL_gl_LIBRARY}/Headers) - set(OPENGL_glu_LIBRARY ${OPENGL_gl_LIBRARY}) endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(OpenGl - REQUIRED_VARS OPENGL_gl_LIBRARY OPENGL_glu_LIBRARY OPENGL_INCLUDE_DIR) + REQUIRED_VARS OPENGL_gl_LIBRARY OPENGL_INCLUDE_DIR) if(OPENGL_FOUND) set(OPENGL_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR}) - set(OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}) + set(OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY}) set(OPENGL_DEFINITIONS -DHAS_GL=1) endif() -mark_as_advanced(OPENGL_INCLUDE_DIR OPENGL_gl_LIBRARY OPENGL_glu_LIBRARY) +mark_as_advanced(OPENGL_INCLUDE_DIR OPENGL_gl_LIBRARY) |