WITH_PYTHON_INSTALL_NUMPY option for unix/cmake, just copies from site-packages.
[blender.git] / CMakeLists.txt
index 16de9a4055e72c4e5e8a9effc509a98dbc5c1d6e..e8bdc5375fca46f344a59723082136ea8f0fb021 100644 (file)
@@ -228,6 +228,7 @@ if(UNIX AND NOT APPLE)
        option(WITH_INSTALL_PORTABLE "Install redistributeable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON)
 endif()
 option(WITH_PYTHON_INSTALL       "Copy system python into the blender install folder" ON)
+option(WITH_PYTHON_INSTALL_NUMPY "Copy system numpy into the blender install folder"  ON)
 option(WITH_MINGW64                   "Use the 64-bit version of MinGW" OFF)
 mark_as_advanced(WITH_MINGW64)
 
@@ -1612,6 +1613,13 @@ if(WITH_PYTHON)
                                                        "to a valid python include path. Containing "
                                                        "Python.h for python version \"${PYTHON_VERSION}\"")
        endif()
+
+       if(WITH_PYTHON_INSTALL_NUMPY)
+               if(NOT EXISTS "${PYTHON_LIBPATH}/python${PYTHON_VERSION}/site-packages/numpy")
+                       message(WARNING "Numpy path '${PYTHON_LIBPATH}/python${PYTHON_VERSION}/site-packages/numpy' is missing, "
+                                                       "WITH_PYTHON_INSTALL_NUMPY option will be ignored when installing python")
+               endif()
+       endif()
 endif()
 
 
@@ -1668,7 +1676,7 @@ if(FIRST_RUN)
                _setting)
                set(_msg "   * ${_setting}")
                string(LENGTH "${_msg}" _len)
-               while("28" GREATER "${_len}")
+               while("32" GREATER "${_len}")
                        set(_msg "${_msg} ")
                         math(EXPR _len "${_len} + 1")
                endwhile()
@@ -1728,6 +1736,7 @@ if(FIRST_RUN)
 
        info_cfg_text("Python:")
        info_cfg_option(WITH_PYTHON_INSTALL)
+       info_cfg_option(WITH_PYTHON_INSTALL_NUMPY)
        info_cfg_option(WITH_PYTHON_MODULE)
        info_cfg_option(WITH_PYTHON_SAFETY)