diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-21 02:39:29 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-21 02:39:29 +0300 |
commit | c30149991c9417106577e2d96112b16433910215 (patch) | |
tree | 9b686c141ddf2c9346ebe0beb3b3cfc3aaacf73f /build_files | |
parent | 55a0e21a03e88e5489dd6f53a91b6f3a6f770d9a (diff) |
Experimental option to build blender as a python module, rather then blender embedding python.
CMake build option WITH_PYTHON_MODULE, will build ./bin/bpy.so
This allows 'bpy' to be imported from python or other applications/IDE's which embed python, eg:
python -c "import bpy ; bpy.ops.render.render(write_still=True)"
This runs in background mode and has similar restrictions to running a script:
blender --background --python test.py
TODO:
- install to site-packages with blender scripts
- add support for imp.reload()
Diffstat (limited to 'build_files')
-rw-r--r-- | build_files/cmake/macros.cmake | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 68a3510116c..a7ad2d64b13 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -66,7 +66,7 @@ macro(SETUP_LIBDIRS) link_directories(${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${FREETYPE_LIBPATH}) - if(WITH_PYTHON) + if(WITH_PYTHON AND NOT WITH_PYTHON_MODULE) link_directories(${PYTHON_LIBPATH}) endif() if(WITH_INTERNATIONAL) @@ -127,7 +127,7 @@ macro(setup_liblinks target_link_libraries(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${JPEG_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${LLIBS}) # since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions - if(WITH_PYTHON) + if(WITH_PYTHON AND NOT WITH_PYTHON_MODULE) target_link_libraries(${target} ${PYTHON_LINKFLAGS}) if(WIN32 AND NOT UNIX) |