diff --git a/cmake/Config.cmake b/cmake/Config.cmake index 672e0536..625fd681 100644 --- a/cmake/Config.cmake +++ b/cmake/Config.cmake @@ -53,7 +53,7 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # detect OS X version. (use '/usr/bin/sw_vers -productVersion' to extract V from '10.V.x'.) EXEC_PROGRAM(/usr/bin/sw_vers ARGS -productVersion OUTPUT_VARIABLE MACOSX_VERSION_RAW) - STRING(REGEX REPLACE "10\\.([0-9]).*" "\\1" MACOSX_VERSION "${MACOSX_VERSION_RAW}") + STRING(REGEX REPLACE "10\\.([0-9]+).*" "\\1" MACOSX_VERSION "${MACOSX_VERSION_RAW}") if(${MACOSX_VERSION} LESS 7) message(FATAL_ERROR "Unsupported version of OS X: ${MACOSX_VERSION_RAW}") return() diff --git a/src/SFML/Window/OSX/WindowImplCocoa.mm b/src/SFML/Window/OSX/WindowImplCocoa.mm index d1ff6d04..2484c38c 100644 --- a/src/SFML/Window/OSX/WindowImplCocoa.mm +++ b/src/SFML/Window/OSX/WindowImplCocoa.mm @@ -225,7 +225,7 @@ void WindowImplCocoa::setUpProcess(void) // Register an application delegate if there is none if (![[SFApplication sharedApplication] delegate]) - [NSApp setDelegate:[[[SFApplicationDelegate alloc] init] autorelease]]; + [[NSApplication sharedApplication] setDelegate:[[SFApplicationDelegate alloc] init]]; // Create menus for the application (before finishing launching!) [SFApplication setUpMenuBar];