when building blender as a py module use add_library(... MODULE on all systems, was...
[blender.git] / source / creator / CMakeLists.txt
index 180d0123ae66b4b451fa9795c142f56d01d48de9..d8c0a5a4f0db421398378b5ad3fb0ea02aa2236b 100644 (file)
@@ -165,36 +165,27 @@ if(WITH_PYTHON_MODULE)
        add_definitions(-DWITH_PYTHON_MODULE)
 
        # creates ./bin/bpy.so which can be imported as a python module.
-       if(APPLE)
-               add_library(blender MODULE ${SRC})
-               set_target_properties(
-                       blender
-                       PROPERTIES
-                               PREFIX ""
-                               OUTPUT_NAME bpy
-                               LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
-               )
+       #
+       # note that 'SHARED' works on Linux and Windows,
+       # but not OSX which _must_ be 'MODULE'
+       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
+       )
 
-       else(APPLE)
-               add_library(blender SHARED ${SRC})
+       if(WIN32)
+               # python modules use this
                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
+                       SUFFIX ".pyd"
                )
-
-               if(WIN32)
-                       # python modules use this
-                       set_target_properties(
-                               blender
-                               PROPERTIES
-                               SUFFIX ".pyd"
-                       )
-               endif()
-       endif(APPLE)
+       endif()
 
 else()
        add_executable(blender ${EXETYPE} ${SRC})