OSX: complety remove the cocoa options, definitions and conditionals now
authorJens Verwiebe <info@jensverwiebe.de>
Tue, 5 Nov 2013 15:37:59 +0000 (15:37 +0000)
committerJens Verwiebe <info@jensverwiebe.de>
Tue, 5 Nov 2013 15:37:59 +0000 (15:37 +0000)
CMakeLists.txt
SConstruct
build_files/scons/tools/btools.py
source/blender/quicktime/SConscript
source/blender/quicktime/apple/quicktime_export.c
source/blender/windowmanager/intern/wm_window.c

index c34fc5acb3179a6985adee6eb9b3ced08228f777..1302fd5bdfabb10c112e5520b270233121b5ed65 100644 (file)
@@ -380,7 +380,6 @@ if(APPLE)
                add_definitions("-DMACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}")
        endif()
 
-       option(WITH_COCOA         "Use Cocoa framework instead of deprecated Carbon" ON)
        option(USE_QTKIT          "Use QtKit instead of Carbon quicktime (needed for having partial quicktime for 64bit)" OFF)
        option(WITH_LIBS10.5  "Use 10.5 libs (needed for 64bit builds)" OFF)
        if(CMAKE_OSX_ARCHITECTURES MATCHES x86_64)
@@ -1612,47 +1611,40 @@ elseif(APPLE)
                set(PLATFORM_LINKLIBS stdc++)
        endif()
 
-       if(WITH_COCOA)
-               set(PLATFORM_CFLAGS "-pipe -funsigned-char -DGHOST_COCOA")
-               set(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Cocoa -framework Carbon -framework AudioUnit -framework AudioToolbox -framework CoreAudio")
-               if(USE_QTKIT)
-                       set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DUSE_QTKIT")
-                       set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QTKit")
-                       if(CMAKE_OSX_ARCHITECTURES MATCHES i386)
-                               set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QuickTime")
-                               # libSDL still needs 32bit carbon quicktime
-                       endif()
-               elseif(WITH_CODEC_QUICKTIME)
+       set(PLATFORM_CFLAGS "-pipe -funsigned-char")
+       set(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Cocoa -framework Carbon -framework AudioUnit -framework AudioToolbox -framework CoreAudio")
+       if(USE_QTKIT)
+               set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DUSE_QTKIT")
+               set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QTKit")
+               if(CMAKE_OSX_ARCHITECTURES MATCHES i386)
                        set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QuickTime")
+                       # libSDL still needs 32bit carbon quicktime
                endif()
+       elseif(WITH_CODEC_QUICKTIME)
+               set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QuickTime")
+       endif()
 
-               # XXX - SOME MAC DEV PLEASE TEST WITH THE SDK INSTALLED!
-               # ALSO SHOULD BE MOVED INTO OWN MODULE WHEN FUNCTIONAL
-               if(WITH_INPUT_NDOF)
-                       # This thread it *should* work and check the framework - campbell
-                       # http://www.cmake.org/pipermail/cmake/2005-December/007740.html
-                       find_library(3DCONNEXION_CLIENT_FRAMEWORK
-                               NAMES 3DconnexionClient
-                       )
-                       if(NOT 3DCONNEXION_CLIENT_FRAMEWORK)
-                               set(WITH_INPUT_NDOF OFF)
-                       endif()
+       # XXX - SOME MAC DEV PLEASE TEST WITH THE SDK INSTALLED!
+       # ALSO SHOULD BE MOVED INTO OWN MODULE WHEN FUNCTIONAL
+       if(WITH_INPUT_NDOF)
+               # This thread it *should* work and check the framework - campbell
+               # http://www.cmake.org/pipermail/cmake/2005-December/007740.html
+               find_library(3DCONNEXION_CLIENT_FRAMEWORK
+                       NAMES 3DconnexionClient
+               )
+               if(NOT 3DCONNEXION_CLIENT_FRAMEWORK)
+                       set(WITH_INPUT_NDOF OFF)
+               endif()
 
-                       if(WITH_INPUT_NDOF)
-                               set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -F/Library/Frameworks -weak_framework 3DconnexionClient")
-                               set(NDOF_INCLUDE_DIRS /Library/Frameworks/3DconnexionClient.framework/Headers )
-                       endif()
+               if(WITH_INPUT_NDOF)
+                       set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -F/Library/Frameworks -weak_framework 3DconnexionClient")
+                       set(NDOF_INCLUDE_DIRS /Library/Frameworks/3DconnexionClient.framework/Headers )
                endif()
+       endif()
 
        if(WITH_JACK)
                set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -F/Library/Frameworks -weak_framework jackmp")
        endif()
-
-       else()
-               set(PLATFORM_CFLAGS "-pipe -funsigned-char")
-               set(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime")
-               set(WITH_INPUT_NDOF OFF)  # unsupported
-       endif()
        
        if(WITH_PYTHON_MODULE OR WITH_PYTHON_FRAMEWORK)
                set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/Python")# force cmake to link right framework
index 9f9eaa886a32fd58f68097cad604bb435fc5b59f..07227e6bd0632d40389f3c4fe6b8cc86a37b94d2 100644 (file)
@@ -342,9 +342,6 @@ if env['WITH_BF_OPENMP'] == 1:
             else:
                 env.Append(CCFLAGS=['-fopenmp'])
 
-if env['WITH_GHOST_COCOA'] == True:
-    env.Append(CPPFLAGS=['-DGHOST_COCOA'])
-
 if env['USE_QTKIT'] == True:
     env.Append(CPPFLAGS=['-DUSE_QTKIT'])
 
index 9a5521fff44abd6f8cb3fd11b28857352926843d..9ad4315f442452555706ce9796595a1207709f17 100644 (file)
@@ -138,7 +138,6 @@ def validate_arguments(args, bc):
             'WITHOUT_BF_PYTHON_INSTALL', 'WITHOUT_BF_PYTHON_UNPACK', 'WITH_BF_PYTHON_INSTALL_NUMPY',
             'WITHOUT_BF_OVERWRITE_INSTALL',
             'WITH_BF_OPENMP', 'BF_OPENMP', 'BF_OPENMP_LIBPATH', 'WITH_BF_STATICOPENMP', 'BF_OPENMP_STATIC_STATIC',
-            'WITH_GHOST_COCOA',
             'WITH_GHOST_SDL',
             'WITH_GHOST_XDND',
             'WITH_X11_XINPUT',
@@ -424,7 +423,6 @@ def read_opts(env, cfg, args):
         ('BF_OPENMP', 'Base path to OpenMP (used when cross-compiling with older versions of WinGW)', ''),
         ('BF_OPENMP_INC', 'Path to OpenMP includes (used when cross-compiling with older versions of WinGW)', ''),
         ('BF_OPENMP_LIBPATH', 'Path to OpenMP libraries (used when cross-compiling with older versions of WinGW)', ''),
-        (BoolVariable('WITH_GHOST_COCOA', 'Use Cocoa-framework if true', True)),
         (BoolVariable('WITH_GHOST_SDL', 'Enable building blender against SDL for windowing rather then the native APIs', False)),
         (BoolVariable('WITH_X11_XINPUT', 'Enable X11 Xinput (tablet support and unicode input)', True)),
         (BoolVariable('WITH_X11_XF86VMODE', 'Enable X11 video mode switching', True)),
index a6debf0622645f7bad58c7e74eaaae8d1aae4705..7d726ed7c7a61ea6e6fa0852fc7352681c5f0069 100644 (file)
@@ -58,8 +58,5 @@ priorities = [200,235]
 
 defs=['WITH_QUICKTIME']
 
-if env['WITH_GHOST_COCOA']:
-    defs.append('GHOST_COCOA')
-    env.BlenderLib ('bf_quicktime', sources=source_files, includes=incs, defines=defs, libtype=types, priority=priorities, cc_compilerchange='/usr/bin/gcc', cxx_compilerchange='/usr/bin/g++') # always use default-Apple-gcc for objC language, gnu-compilers do not support it fully yet
-else:
-    env.BlenderLib ('bf_quicktime', sources=source_files, includes=incs, defines=defs, libtype=types, priority=priorities)
+env.BlenderLib ('bf_quicktime', sources=source_files, includes=incs, defines=defs, libtype=types, priority=priorities, cc_compilerchange='/usr/bin/gcc', cxx_compilerchange='/usr/bin/g++') # always use default-Apple-gcc for objC language, gnu-compilers do not support it fully yet
+
index 52ef21e4f39484db232555644ea069a7e4f4b17c..67be8b169c62b47184695bb4800aa47212f46996 100644 (file)
@@ -890,7 +890,7 @@ static int ED_operator_setqtcodec(bContext *C)
        return G.have_quicktime != FALSE;
 }
 
-#if defined(__APPLE__) && defined(GHOST_COCOA)
+#if defined(__APPLE__)
 /* Need to set up a Cocoa NSAutoReleasePool to avoid memory leak
  * And it must be done in an objC file, so use a GHOST_SystemCocoa.mm function for that */
 extern int cocoa_request_qtcodec_settings_exec(bContext *C, wmOperator *op);
@@ -910,7 +910,7 @@ void SCENE_OT_render_data_set_quicktime_codec(wmOperatorType *ot)
        ot->idname = "SCENE_OT_render_data_set_quicktime_codec";
        
        /* api callbacks */
-#if defined(__APPLE__) && defined(GHOST_COCOA)
+#if defined(__APPLE__)
        ot->exec = cocoa_request_qtcodec_settings_exec;
 #else
        ot->exec = request_qtcodec_settings_exec;
index 9e89c17e02400b634601a77b427b41f83d58e4c9..5f3443406439dfe4c5f40e530313e70c7d8649c4 100644 (file)
@@ -133,10 +133,6 @@ static void wm_window_check_position(rcti *rect)
        
        wm_get_screensize(&width, &height);
        
-#if defined(__APPLE__) && !defined(GHOST_COCOA)
-       height -= 70;
-#endif
-       
        if (rect->xmin < 0) {
                rect->xmax -= rect->xmin;
                rect->xmin  = 0;
@@ -338,12 +334,6 @@ void wm_window_title(wmWindowManager *wm, wmWindow *win)
                 * in case of OS application terminate request (e.g. OS Shortcut Alt+F4, Cmd+Q, (...), or session end) */
                GHOST_SetWindowModifiedState(win->ghostwin, (GHOST_TUns8) !wm->file_saved);
                
-#if defined(__APPLE__) && !defined(GHOST_COCOA)
-               if (wm->file_saved)
-                       GHOST_SetWindowState(win->ghostwin, GHOST_kWindowStateUnModified);
-               else
-                       GHOST_SetWindowState(win->ghostwin, GHOST_kWindowStateModified);
-#endif
        }
 }
 
@@ -428,20 +418,12 @@ void wm_window_add_ghostwindows(wmWindowManager *wm)
        if (wm_init_state.size_x == 0) {
                wm_get_screensize(&wm_init_state.size_x, &wm_init_state.size_y);
                
-#if defined(__APPLE__) && !defined(GHOST_COCOA)
-               /* Cocoa provides functions to get correct max window size */
-               {
-                       extern void wm_set_apple_prefsize(int, int);    /* wm_apple.c */
-                       
-                       wm_set_apple_prefsize(wm_init_state.size_x, wm_init_state.size_y);
-               }
-#else
-               /* note!, this isnt quite correct, active screen maybe offset 1000s if PX,
-                * we'd need a wm_get_screensize like function that gives offset,
-                * in practice the window manager will likely move to the correct monitor */
-               wm_init_state.start_x = 0;
-               wm_init_state.start_y = 0;
-#endif
+       /* note!, this isnt quite correct, active screen maybe offset 1000s if PX,
+        * we'd need a wm_get_screensize like function that gives offset,
+        * in practice the window manager will likely move to the correct monitor */
+       wm_init_state.start_x = 0;
+       wm_init_state.start_y = 0;
+
 
 #if !defined(__APPLE__) && !defined(WIN32)  /* X11 */
                /* X11, start maximized but use default sane size */