cmake option to disable SDL,
authorCampbell Barton <ideasman42@gmail.com>
Mon, 20 Jul 2009 10:24:53 +0000 (10:24 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 20 Jul 2009 10:24:53 +0000 (10:24 +0000)
bpy_interface.c - change order of checking scripts to avoid calling stat on .py files.

CMakeLists.txt
source/blender/blenkernel/CMakeLists.txt
source/blender/blenlib/SConscript
source/blender/python/intern/bpy_interface.c
source/creator/CMakeLists.txt
source/gameengine/GameLogic/CMakeLists.txt
source/gameengine/Ketsji/CMakeLists.txt

index a4796c2eee90555a4c9de5d372a0e1cebab530ca..47daa1e4b9eed92acc97e4359e58e5f23a6f8a6b 100644 (file)
@@ -63,6 +63,7 @@ OPTION(WITH_OPENEXR           "Enable OpenEXR Support (http://www.openexr.com)"       ON)
 OPTION(WITH_DDS                        "Enable DDS Support"                                    ON)
 OPTION(WITH_FFMPEG             "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)"   OFF)
 OPTION(WITH_PYTHON             "Enable Embedded Python API"                            ON)
+OPTION(WITH_SDL                        "Enable SDL for sound and joystick support"                             ON)
 OPTION(WITH_OPENJPEG           "Enable OpenJpeg Support (http://www.openjpeg.org/)"    OFF)
 OPTION(WITH_OPENAL             "Enable OpenAL Support (http://www.openal.org)"         ON)
 OPTION(WITH_OPENMP             "Enable OpenMP (has to be supported by the compiler)"   OFF)
@@ -133,9 +134,11 @@ IF(UNIX AND NOT APPLE)
   SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
   SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic")
 
-  FIND_PACKAGE(SDL)
-  SET(SDL_INC ${SDL_INCLUDE_DIR})
-  SET(SDL_LIB ${SDL_LIBRARY})
+  IF(WITH_SDL)
+    FIND_PACKAGE(SDL)
+    SET(SDL_INC ${SDL_INCLUDE_DIR})
+    SET(SDL_LIB ${SDL_LIBRARY})
+  ENDIF(WITH_SDL)
 
   FIND_PATH(OPENEXR_INC
     ImfXdr.h
index ebe0ea74c285070d8ea7a3e72e994851c069be0e..92cc206667cedccce355588f8cc0300df095a475 100644 (file)
@@ -34,7 +34,6 @@ SET(INC
   ../../../extern/bullet2/src
   ../nodes ../../../extern/glew/include ../gpu ../makesrna
   ../../../intern/bsp/extern
-  ${SDL_INC}
   ${ZLIB_INC}
 )
 
@@ -55,6 +54,12 @@ IF(WITH_QUICKTIME)
   ADD_DEFINITIONS(-DWITH_QUICKTIME)
 ENDIF(WITH_QUICKTIME)
 
+IF(WITH_SDL)
+  SET(INC ${INC} ${SDL_INC})
+ELSE(WITH_SDL)
+  ADD_DEFINITIONS(-DDISABLE_SDL)
+ENDIF(WITH_SDL)
+
 IF(WITH_FFMPEG)
   SET(INC ${INC} ${FFMPEG_INC})
   ADD_DEFINITIONS(-DWITH_FFMPEG)
index e0411a6fc8029009d5f4e0fdfac1110d0932c20b..3d7d6b63e64f1b659fed2d36a3b766f3eece6471 100644 (file)
@@ -9,9 +9,6 @@ incs += ' ' + env['BF_FREETYPE_INC']
 incs += ' ' + env['BF_ZLIB_INC']
 defs = ''
 
-if env['WITH_BF_SDL']:
-       incs += ' ' + env['BF_SDL_INC']
-
 if env['OURPLATFORM'] == 'linux2':
     cflags='-pthread'
     incs += ' ../../../extern/binreloc/include'
index 6a5d01d9466d0076159a533fc876c753afc223b1..04d70f5a7584e861ec72507cd98f0b3d815da0db 100644 (file)
@@ -511,6 +511,13 @@ void BPY_run_ui_scripts(bContext *C, int reload)
                        if (de->d_name[0] == '.') {
                                /* do nothing, probably .svn */
                        }
+                       else if ((file_extension = strstr(de->d_name, ".py"))) {
+                               /* normal py files? */
+                               if(file_extension && file_extension[3] == '\0') {
+                                       de->d_name[(file_extension - de->d_name) + 1] = '\0';
+                                       bpy_import_module(de->d_name, reload);
+                               }
+                       }
 #ifndef __linux__
                        else if( BLI_join_dirfile(path, dirname, de->d_name), S_ISDIR(BLI_exists(path))) {
 #else
@@ -523,14 +530,6 @@ void BPY_run_ui_scripts(bContext *C, int reload)
                                if(BLI_exists(path)) {
                                        bpy_import_module(de->d_name, reload);
                                }
-                       } else {
-                               /* normal py files */
-                               file_extension = strstr(de->d_name, ".py");
-                               
-                               if(file_extension && file_extension[3] == '\0') {
-                                       de->d_name[(file_extension - de->d_name) + 1] = '\0';
-                                       bpy_import_module(de->d_name, reload);
-                               }
                        }
 
                        if(err==-1) {
index b337167853436a9919ee561e66609ae59f3a0286..35cb3e92b217561b7086a4fda8d8e148ac23a352 100644 (file)
@@ -62,6 +62,10 @@ ELSE(WITH_PYTHON)
   ADD_DEFINITIONS(-DDISABLE_PYTHON)
 ENDIF(WITH_PYTHON)
 
+IF(NOT WITH_SDL)
+  ADD_DEFINITIONS(-DDISABLE_SDL)
+ENDIF(NOT WITH_SDL)
+
 IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
   ADD_DEFINITIONS(-DWITH_BINRELOC)
   INCLUDE_DIRECTORIES(${BINRELOC_INC})
index 7e2bc85bd1f31aca5d79df8faf42b964230329ea..530664dce554ee083782f7686d7b7f6ef8d0d903 100644 (file)
@@ -35,8 +35,13 @@ SET(INC
   ../../../intern/moto/include
   ../../../source/gameengine/Rasterizer
   ${PYTHON_INC}
-  ${SDL_INC}
 )
 
+IF(WITH_SDL)
+  SET(INC ${INC} ${SDL_INC})  
+ELSE(WITH_SDL)
+  ADD_DEFINITIONS(-DDISABLE_SDL)
+ENDIF(WITH_SDL)
+
 BLENDERLIB(bf_logic "${SRC}" "${INC}")
 #env.BlenderLib ( 'bf_logic', sources, Split(incs), [], libtype=['game','player'], priority=[30, 110] )
index ee1ff2c65020c782905b1b4454e46a84eda1919c..f703841c40bfc86a2f62a652a4029dc295f8331a 100644 (file)
 
 FILE(GLOB SRC *.cpp)
 
-#XXX disabled for 2.5 because of missing python
-#SET(SRC 
-#  ${SRC}
-#  ../../../source/blender/python/api2_2x/Mathutils.c
-#  ../../../source/blender/python/api2_2x/Geometry.c
-#  ../../../source/blender/python/api2_2x/constant.c
-#  ../../../source/blender/python/api2_2x/euler.c
-#  ../../../source/blender/python/api2_2x/matrix.c
-#  ../../../source/blender/python/api2_2x/quat.c
-#  ../../../source/blender/python/api2_2x/vector.c
-#  ../../../source/blender/python/api2_2x/bpy_internal_import.c
-#  ../../../source/blender/python/api2_2x/BGL.c
-#)
-
 SET(INC
   .
   ../../../source/kernel/gen_system
@@ -77,8 +63,13 @@ SET(INC
   ../../../extern/solid
   ../../../extern/glew/include
   ${PYTHON_INC}
-  ${SDL_INC}
 )
 
+IF(WITH_SDL)
+  SET(INC ${INC} ${SDL_INC})  
+ELSE(WITH_SDL)
+  ADD_DEFINITIONS(-DDISABLE_SDL)
+ENDIF(WITH_SDL)
+
 BLENDERLIB(bf_ketsji "${SRC}" "${INC}")
 #env.BlenderLib ( 'bf_ketsji', sources, Split(incs), [], libtype=['game','player'], priority=[25, 72], compileflags = cflags )