diff options
author | Jens Verwiebe <info@jensverwiebe.de> | 2012-01-10 20:47:20 +0400 |
---|---|---|
committer | Jens Verwiebe <info@jensverwiebe.de> | 2012-01-10 20:47:20 +0400 |
commit | 68a2ac668edd0ccab74361dfd790d98cb9fc7ab1 (patch) | |
tree | 6b08b0f6903e3de0f78f6ea4df49645e12f73729 /source/creator | |
parent | 9d4f3fdb81cc71866f94e2ad9499589bd1789e03 (diff) |
OSX: fix compiling Blender as MODULE
Diffstat (limited to 'source/creator')
-rw-r--r-- | source/creator/CMakeLists.txt | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index bfb27f0a20f..0938798c185 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -165,24 +165,38 @@ if(WITH_PYTHON_MODULE) add_definitions(-DWITH_PYTHON_MODULE) # creates ./bin/bpy.so which can be imported as a python module. - add_library(blender SHARED ${SRC}) - set_target_properties( - blender - PROPERTIES - PREFIX "" - OUTPUT_NAME bpy - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin - RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin # only needed on windows - ) + if(APPLE) + add_library(blender MODULE ${SRC}) + set_target_properties( + blender + PROPERTIES + PREFIX "" + OUTPUT_NAME bpy + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin # only needed on windows + ) + TARGET_LINK_LIBRARIES(blender -Wl,-undefined -Wl,dynamic_lookup) - if(WIN32) - # python modules use this + else(APPLE) + add_library(blender SHARED ${SRC}) set_target_properties( blender PROPERTIES - SUFFIX ".pyd" + PREFIX "" + OUTPUT_NAME bpy + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin # only needed on windows ) - endif() + + if(WIN32) + # python modules use this + set_target_properties( + blender + PROPERTIES + SUFFIX ".pyd" + ) + endif() + endif(APPLE) else() add_executable(blender ${EXETYPE} ${SRC}) |