support for blender as a module on win32.

This commit is contained in:
Campbell Barton
2011-03-24 00:14:49 +00:00
parent 261f74115d
commit c210b3991a
3 changed files with 20 additions and 2 deletions

View File

@@ -1016,6 +1016,13 @@ if(WITH_OPENMP)
mark_as_advanced(OpenMP_CXX_FLAGS)
endif()
#-----------------------------------------------------------------------------
# Configure Python.
if(WITH_PYTHON_MODULE)
add_definitions(-DPy_ENABLE_SHARED)
endif()
#-----------------------------------------------------------------------------
# Extra compile flags

View File

@@ -66,7 +66,7 @@ macro(SETUP_LIBDIRS)
link_directories(${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${FREETYPE_LIBPATH})
if(WITH_PYTHON AND NOT WITH_PYTHON_MODULE)
if(WITH_PYTHON) # AND NOT WITH_PYTHON_MODULE # WIN32 needs
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 AND NOT WITH_PYTHON_MODULE)
if(WITH_PYTHON) # AND NOT WITH_PYTHON_MODULE # WIN32 needs
target_link_libraries(${target} ${PYTHON_LINKFLAGS})
if(WIN32 AND NOT UNIX)

View File

@@ -169,7 +169,18 @@ if(WITH_PYTHON_MODULE)
PREFIX ""
OUTPUT_NAME bpy
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/ # only needed on windows
)
if(WIN32)
# python modules use this
set_target_properties(
blender
PROPERTIES
SUFFIX ".pyd"
)
endif()
else()
add_executable(blender ${EXETYPE} ${SRC})
endif()