[Bf-blender-cvs] [c436c78] master: Build system support for numpy on ms-windows
Campbell Barton
noreply at git.blender.org
Tue Mar 4 14:24:14 CET 2014
Commit: c436c78de1d2f6fcac46e69c5c81ca2af5f839e5
Author: Campbell Barton
Date: Wed Mar 5 00:20:11 2014 +1100
https://developer.blender.org/rBc436c78de1d2f6fcac46e69c5c81ca2af5f839e5
Build system support for numpy on ms-windows
===================================================================
M CMakeLists.txt
M build_files/scons/tools/Blender.py
M source/creator/CMakeLists.txt
===================================================================
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3e7ac95..46690f3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2209,7 +2209,9 @@ if(WITH_PYTHON)
"Python.h for python version \"${PYTHON_VERSION}\"")
endif()
- if(WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY)
+ if(WIN32)
+ # pass, we have this in an archive to extract
+ elseif(WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY)
# set but invalid
# -- disabled until we make numpy bundled with blender - campbell
if((NOT ${PYTHON_NUMPY_PATH} STREQUAL "") AND (NOT ${PYTHON_NUMPY_PATH} MATCHES NOTFOUND))
diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py
index cc60b88..2015bb4 100644
--- a/build_files/scons/tools/Blender.py
+++ b/build_files/scons/tools/Blender.py
@@ -626,6 +626,24 @@ def WinPyBundle(target=None, source=None, env=None):
print "Unpacking '" + py_tar + "' to '" + py_target + "'"
untar_pybundle(py_tar,py_target,exclude_re)
+ # -------------
+ # Extract Numpy
+ py_tar = env.subst(env['LCGDIR'])
+ if py_tar[0] == '#':
+ py_tar = py_tar[1:]
+ py_tar += '/release/python' + env['BF_PYTHON_VERSION'].replace('.','') + '_numpy_1.8.tar.gz'
+
+ py_target = env.subst(env['BF_INSTALLDIR'])
+ if py_target[0] == '#':
+ py_target = py_target[1:]
+ py_target = os.path.join(py_target, VERSION, 'python', 'lib', 'site-packages')
+ # rmtree handled above
+ # files are cleaned up in their archive
+ exclude_re = []
+ print("Unpacking '" + py_tar + "' to '" + py_target + "'")
+ untar_pybundle(py_tar, py_target, exclude_re)
+
+
def my_appit_print(target, source, env):
a = '%s' % (target[0])
d, f = os.path.split(a)
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 4d12040..d765c33 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -576,6 +576,16 @@ elseif(WIN32)
"
)
+ if(WITH_PYTHON_INSTALL_NUMPY)
+ install(
+ CODE
+ "
+ execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \"${TARGETDIR_VER}/python/lib/site-packages\"
+ \"${CMAKE_COMMAND}\" -E tar xzfv \"${LIBDIR}/release/python${_PYTHON_VERSION_NO_DOTS}_numpy_1.8.tar.gz\")
+ "
+ )
+ endif()
+
# doesnt work, todo
# install(CODE "execute_process(COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/ -name '*.so' -exec strip -s {} '\;')")
endif()
More information about the Bf-blender-cvs
mailing list