From 2980071f73776ba36b42f4b3c5304bbe38aecddd Mon Sep 17 00:00:00 2001 From: Krishna Vedala <7001608+kvedala@users.noreply.github.com> Date: Tue, 7 Jul 2020 10:08:15 -0400 Subject: [PATCH] use the macro USE_GLUT --- graphics/CMakeLists.txt | 3 +-- graphics/spirograph.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/graphics/CMakeLists.txt b/graphics/CMakeLists.txt index f07dfc52a..ecf21e2a6 100644 --- a/graphics/CMakeLists.txt +++ b/graphics/CMakeLists.txt @@ -50,8 +50,7 @@ foreach( testsourcefile ${APP_SOURCES} ) target_include_directories(${testname} PRIVATE ${GLUT_INCLUDE_DIRS}) target_link_libraries(${testname} PRIVATE OpenGL::GL ${GLUT_LIBRARIES}) endif() - else(OpenGL_FOUND) - target_compile_definitions(${testname} PRIVATE NO_OPENGL) + target_compile_definitions(${testname} PRIVATE USE_GLUT) endif(OpenGL_FOUND) if(APPLE) diff --git a/graphics/spirograph.cpp b/graphics/spirograph.cpp index 52cf50963..f4b526ac5 100644 --- a/graphics/spirograph.cpp +++ b/graphics/spirograph.cpp @@ -25,11 +25,13 @@ #ifdef _OPENMP #include #endif +#ifdef USE_GLUT #ifdef __APPLE__ #include // include path on Macs is different #else #include #endif // __APPLE__ +#endif /** * @namespace spirograph Functions related to spirograph.cpp @@ -112,7 +114,7 @@ void test() { fp.close(); } -#ifndef NO_OPENGL +#ifdef USE_GLUT /** A wrapper that is not available in all GLUT implementations. */ static inline void glutBitmapString(void *font, char *message) { @@ -219,7 +221,7 @@ void timer_cb(int t) { int main(int argc, char **argv) { spirograph::test(); -#ifndef NO_OPENGL +#ifdef USE_GLUT glutInit(&argc, argv); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE); glutCreateWindow("Spirograph");