summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Fonseca <jose.r.fonseca@gmail.com>2014-10-21 20:26:04 +0100
committerJosé Fonseca <jose.r.fonseca@gmail.com>2014-10-21 20:26:56 +0100
commitd014902154033339f0bea1a159cb1375ba6bd04d (patch)
treeb74121e6b81a32a15f59d158e8b29481bee8a95d
parent94437a72d55c4f9c546ae712603fd7b9de017ad7 (diff)
cmake: Define HAVE_FREEGLUT when glutInitContextProfile symbol is present.
Just like the configure.ac does. Trivial.
-rw-r--r--CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 88a8b88f..c3e217f5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,6 +4,7 @@ project (mesademos)
include (FindPkgConfig)
include (CheckCCompilerFlag)
+include (CheckSymbolExists)
find_package (OpenGL REQUIRED)
find_package (GLUT REQUIRED)
@@ -25,6 +26,14 @@ if (PKG_CONFIG_FOUND AND NOT WIN32)
pkg_check_modules (VG vg)
endif ()
+# Check for FreeGLUT 2.6 or later
+set (CMAKE_REQUIRED_INCLUDES "${GLUT_INCLUDE_DIR}")
+set (CMAKE_REQUIRED_LIBRARIES "${GLUT_glut_LIBRARY}")
+check_symbol_exists ("glutInitContextProfile" "GL/glut.h;GL/freeglut.h" HAVE_FREEGLUT)
+if (HAVE_FREEGLUT)
+ add_definitions (-DHAVE_FREEGLUT)
+endif ()
+
if (UNIX)
link_libraries(m)
endif (UNIX)