diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f571a82b..1a14d742f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -166,13 +166,18 @@ IF (OSG_MAINTAINER) ENDIF(OSG_MAINTAINER) -IF(APPLE AND NOT ANDROID) +IF(NOT ANDROID) +IF(APPLE) # Determine the canonical name of the selected Platform SDK EXECUTE_PROCESS(COMMAND "/usr/bin/sw_vers" "-productVersion" OUTPUT_VARIABLE OSG_OSX_SDK_NAME OUTPUT_STRIP_TRAILING_WHITESPACE) - STRING(SUBSTRING "${OSG_OSX_SDK_NAME}" 0 4 OSG_OSX_SDK_NAME) - SET(OSG_OSX_SDK_NAME "macosx${OSG_OSX_SDK_NAME}") + STRING(REPLACE "." ";" MACOS_VERSION_LIST ${OSG_OSX_SDK_NAME}) + LIST(GET MACOS_VERSION_LIST 0 MACOS_VERSION_MAJOR) + LIST(GET MACOS_VERSION_LIST 1 MACOS_VERSION_MINOR) + LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH) + + SET(OSG_OSX_SDK_NAME "macosx${MACOS_VERSION_MAJOR}.${MACOS_VERSION_MINOR}") # Trying to get CMake to generate an XCode IPhone project, current efforts are to get iphoneos sdk 3.1 working # Added option which needs manually setting to select the IPhone SDK for building. We can only have one of the below @@ -218,11 +223,14 @@ IF(APPLE AND NOT ANDROID) OPTION(OSG_COMPILE_FRAMEWORKS "compile frameworks instead of dylibs (experimental)" OFF) SET(OSG_COMPILE_FRAMEWORKS_INSTALL_NAME_DIR "@executable_path/../Frameworks" CACHE STRING "install name dir for compiled frameworks") ELSE() - IF(NOT ANDROID) - # Non-Apple: Find OpenGL - FIND_PACKAGE(OpenGL) - ENDIF() + # Non-Apple: Find OpenGL + FIND_PACKAGE(OpenGL) ENDIF() +ENDIF() + + + + IF(UNIX AND NOT ANDROID) # Not sure what this will do on Cygwin and Msys @@ -1044,7 +1052,7 @@ IF(APPLE AND NOT ANDROID) # FORCE is used because the options are not reflected in the UI otherwise. # Seems like a good place to add version specific compiler flags too. IF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE) - IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9") + IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.10") SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "imageio" CACHE STRING "Forced imageio default image plugin for OSX" FORCE) # 64 Bit Works, i386,ppc is not supported any more SET(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX" FORCE) diff --git a/CMakeModules/FindAVFoundation.cmake b/CMakeModules/FindAVFoundation.cmake index ff888f025..63bc3817c 100644 --- a/CMakeModules/FindAVFoundation.cmake +++ b/CMakeModules/FindAVFoundation.cmake @@ -30,7 +30,7 @@ ELSE() # AVFoundation exists since 10.7, but only 10.8 has all features necessary for OSG # so check the SDK-setting - IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9") + IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.10") # nothing special here ;-) ELSE() MESSAGE("AVFoundation disabled for SDK < 10.8") diff --git a/CMakeModules/FindQuickTime.cmake b/CMakeModules/FindQuickTime.cmake index 3d3cf6e1f..bffc99b94 100644 --- a/CMakeModules/FindQuickTime.cmake +++ b/CMakeModules/FindQuickTime.cmake @@ -65,7 +65,7 @@ ELSE() ENDIF() # Disable quicktime for >= 10.7, as it's officially deprecated - IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.7" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9") + IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.7" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.10") MESSAGE("disabling quicktime because it's not supported by the selected SDK ${OSG_OSX_SDK_NAME}") SET(QUICKTIME_FOUND "NO") ENDIF() diff --git a/src/osgViewer/PixelBufferCocoa.mm b/src/osgViewer/PixelBufferCocoa.mm index 343840ff6..24c5d28a5 100644 --- a/src/osgViewer/PixelBufferCocoa.mm +++ b/src/osgViewer/PixelBufferCocoa.mm @@ -74,7 +74,7 @@ bool PixelBufferCocoa::realizeImplementation() _context = [[NSOpenGLContext alloc] initWithFormat: pixelformat shareContext: sharedContext]; NSOpenGLPixelBuffer* pbuffer = [[NSOpenGLPixelBuffer alloc] initWithTextureTarget: _traits->target textureInternalFormat: _traits->format textureMaxMipMapLevel: _traits->level pixelsWide: _traits->width pixelsHigh: _traits->height]; - [_context setPixelBuffer: pbuffer cubeMapFace: _traits->face mipMapLevel:_traits->level currentVirtualScreen: nil]; + [_context setPixelBuffer: pbuffer cubeMapFace: _traits->face mipMapLevel:_traits->level currentVirtualScreen: 0]; [pool release];