Fix for numpy with nmake and missing directory
authorChad Fraleigh <chadf@triularity.org>
Sun, 16 Aug 2015 12:32:14 +0000 (14:32 +0200)
committerMartijn Berger <martijn.berger@gmail.com>
Sun, 16 Aug 2015 12:34:45 +0000 (14:34 +0200)
When using the nmake generator from cmake, numpy fails to extract during build because the working directory doesn't exist yet.

Reviewers: juicyfruit

Differential Revision: https://developer.blender.org/D1466

source/creator/CMakeLists.txt

index 5930fd36988e27b308688d9977c00318537ea61f..a35891751976d14495f086baa5d35c2447dfed41 100644 (file)
@@ -678,9 +678,13 @@ elseif(WIN32)
                        )
 
                        if(WITH_PYTHON_INSTALL_NUMPY)
+                               add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages
+                                       COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages)
+
                                add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages/numpy
                                        COMMAND ${CMAKE_COMMAND} -E tar xzvf "${LIBDIR}/release/python${_PYTHON_VERSION_NO_DOTS}_numpy_1.9.tar.gz"
                                        DEPENDS ${LIBDIR}/release/python${_PYTHON_VERSION_NO_DOTS}_numpy_1.9.tar.gz
+                                               ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages
                                        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages)
                                add_custom_target(python_numpy ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages/numpy)
                                install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages/numpy