Cmake/Windows: Fix numpy being unpacked every build.
authorRay Molenkamp <github@lazydodo.com>
Thu, 6 Jun 2019 02:51:00 +0000 (20:51 -0600)
committerRay Molenkamp <github@lazydodo.com>
Thu, 6 Jun 2019 02:51:00 +0000 (20:51 -0600)
Every time you build cmake it unpacks numpy. It is seemingly
very unhappy with OUTPUTS being directories rather than files.

The creating of the directory is not needed, so that step was easy
to resolve, next problem: was there was not a target that outputs
the tarball so it too was deemed out of date. Losing that dependency
as well, fixes the issue, while this is not great if we ever update
the libs in svn, we are planning to drastically change the way we
package python for windows so this is ok for now, but needs to be
addressed with the next python update, T65547 is the tracking ticket
for this.

Tested with VS2015/2017/2019 with both msbuild and ninja generators

source/creator/CMakeLists.txt

index 6f5f413711fe137543f1e2dde8fdcc8db2c5fbea..41412af9aeafe624e3f6a68fa712466b8a9f3203 100644 (file)
@@ -737,22 +737,15 @@ elseif(WIN32)
 
       if(WITH_PYTHON_INSTALL_NUMPY)
         set(PYTHON_NUMPY_VERSION 1.15)
-        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
+          OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages/numpy/__init__.py
           COMMAND ${CMAKE_COMMAND} -E
                   tar xzvf "${LIBDIR}/release/python${_PYTHON_VERSION_NO_DOTS}_numpy_${PYTHON_NUMPY_VERSION}$<$<CONFIG:Debug>:d>.tar.gz"
-          DEPENDS
-            ${LIBDIR}/release/python${_PYTHON_VERSION_NO_DOTS}_numpy_${PYTHON_NUMPY_VERSION}$<$<CONFIG:Debug>:d>.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
+          DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages/numpy/__init__.py
         )
         install(
           DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages/numpy