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");