From 477dd3cda2137682d41328fc2594d83d3e2116cb Mon Sep 17 00:00:00 2001 From: Laurens Voerman Date: Wed, 11 Sep 2019 10:22:16 +0200 Subject: [PATCH] fix apple carbon reference --- CMakeLists.txt | 1 + include/osgViewer/GraphicsWindow | 4 ++++ src/osg/Config.in | 1 + 3 files changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ad2a6f661..c0507c369 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,6 +86,7 @@ ELSEIF(APPLE) # OSX >= 10.5 uses Cocoa windowing system, otherwise Carbon IF(OSG_OSX_VERSION VERSION_LESS 10.5) SET(OSG_WINDOWING_SYSTEM "Carbon" CACHE STRING "Windowing system type for graphics window creation; options: Carbon, Cocoa, X11 or None.") + SET(OSG_WINDOWING_SYSTEM_CARBON ON INTERNAL "use Carbon (apple; 32 bit only)") ELSE() SET(OSG_WINDOWING_SYSTEM "Cocoa" CACHE STRING "Windowing system type for graphics window creation; options: Carbon, Cocoa, X11 or None.") ENDIF() diff --git a/include/osgViewer/GraphicsWindow b/include/osgViewer/GraphicsWindow index 94397e22e..c2eb6aacb 100644 --- a/include/osgViewer/GraphicsWindow +++ b/include/osgViewer/GraphicsWindow @@ -286,7 +286,11 @@ struct GraphicsWindowFunctionProxy #if defined(_WIN32) #define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(Win32) #elif defined(__APPLE__) + #if defined(OSG_WINDOWING_SYSTEM_CARBON) + #define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(Carbon) + #else #define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(Cocoa) + #endif #else #define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(X11) #endif diff --git a/src/osg/Config.in b/src/osg/Config.in index 583b16aa8..342069a08 100644 --- a/src/osg/Config.in +++ b/src/osg/Config.in @@ -36,5 +36,6 @@ #cmakedefine OSG_PROVIDE_READFILE #cmakedefine OSG_USE_DEPRECATED_API #cmakedefine OSG_ENVVAR_SUPPORTED +#cmakedefine OSG_WINDOWING_SYSTEM_CARBON #endif