summaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindGLU.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/modules/FindGLU.cmake')
-rw-r--r--cmake/modules/FindGLU.cmake33
1 files changed, 33 insertions, 0 deletions
diff --git a/cmake/modules/FindGLU.cmake b/cmake/modules/FindGLU.cmake
new file mode 100644
index 0000000..f91d33d
--- /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)