Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-04-30 13:38:32 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-04-30 13:38:32 +0400
commitd113fd8ab70a7df22a4ec4c26fce7a68aa98fb1a (patch)
tree3615dd33ad06108df8ed31d1fe7397f3a28cceec
parente08a46c070cacf61312973392615cc00a1269209 (diff)
WITH_PYTHON_INSTALL_NUMPY option for unix/cmake, just copies from site-packages.
-rw-r--r--CMakeLists.txt11
-rw-r--r--source/creator/CMakeLists.txt21
2 files changed, 31 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 16de9a4055e..e8bdc5375fc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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)
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 0168c06b7da..9168b634250 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -438,7 +438,28 @@ if(UNIX AND NOT APPLE)
# # doesnt work, todo
# install(CODE "execute_process(COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/ -name '*.so' -exec strip -s {} '\;')")
+
+ if(WITH_PYTHON_INSTALL_NUMPY)
+ install(
+ DIRECTORY ${PYTHON_LIBPATH}/python${PYTHON_VERSION}/site-packages/numpy
+ DESTINATION ${TARGETDIR_VER}/python/${_target_LIB}/python${PYTHON_VERSION}/site-packages
+ PATTERN ".svn" EXCLUDE
+ PATTERN "__pycache__" EXCLUDE # * any cache *
+ PATTERN "*.pyc" EXCLUDE # * any cache *
+ PATTERN "*.pyo" EXCLUDE # * any cache *
+ PATTERN "distutils" EXCLUDE # ./distutils
+ PATTERN "oldnumeric" EXCLUDE # ./oldnumeric
+ PATTERN "doc" EXCLUDE # ./doc
+ PATTERN "tests" EXCLUDE # ./tests
+ PATTERN "f2py" EXCLUDE # ./f2py - fortran/python interface code, not fun for blender devs.
+ PATTERN "include" EXCLUDE # include dirs all over, we wont use NumPy/CAPI
+ PATTERN "*.h" EXCLUDE # some includes are not in include dirs
+ PATTERN "*.a" EXCLUDE # ./core/lib/libnpymath.a - for linking, we dont need.
+ )
+ endif()
+
unset(_target_LIB)
+
endif()
endif()
elseif(WIN32)