From 4856e3faf2ed9174fa3134fc712360f9b18c4f06 Mon Sep 17 00:00:00 2001
From: Prabhu Ramachandran <prabhu@aero.iitb.ac.in>
Date: Sun, 25 Nov 2018 20:16:47 -0500
Subject: [PATCH] ENH: Facilitate building wheels.

The VTKPythonPackage does not correctly build wheels with the recent
changes.  By allowing the package to set the VTK_INSTALL_PYTHON_MODULES,
we are able to correctly build wheels.
---
 Utilities/Python/CMakeLists.txt | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/Utilities/Python/CMakeLists.txt b/Utilities/Python/CMakeLists.txt
index 54fd65463cc..7edd4f522d4 100644
--- a/Utilities/Python/CMakeLists.txt
+++ b/Utilities/Python/CMakeLists.txt
@@ -51,14 +51,16 @@ else()
     CACHE INTERNAL "Directory where python modules will be built")
 endif()
 
-if(WIN32 AND NOT CYGWIN)
-  set(VTK_INSTALL_PYTHON_MODULES_DIR
-    "${VTK_INSTALL_RUNTIME_DIR}/${VTK_PYTHON_SITE_PACKAGES_SUFFIX}"
-    CACHE INTERNAL "Directory where python modules will be installed")
-else()
-  set(VTK_INSTALL_PYTHON_MODULES_DIR
-    "${VTK_INSTALL_LIBRARY_DIR}/${VTK_PYTHON_SITE_PACKAGES_SUFFIX}"
-    CACHE INTERNAL "Directory where python modules will be installed")
+if(NOT DEFINED VTK_INSTALL_PYTHON_MODULES_DIR)
+  if(WIN32 AND NOT CYGWIN)
+    set(VTK_INSTALL_PYTHON_MODULES_DIR
+      "${VTK_INSTALL_RUNTIME_DIR}/${VTK_PYTHON_SITE_PACKAGES_SUFFIX}"
+      CACHE INTERNAL "Directory where python modules will be installed")
+  else()
+    set(VTK_INSTALL_PYTHON_MODULES_DIR
+      "${VTK_INSTALL_LIBRARY_DIR}/${VTK_PYTHON_SITE_PACKAGES_SUFFIX}"
+      CACHE INTERNAL "Directory where python modules will be installed")
+  endif()
 endif()
 
 # Export location of python module dirs in install and build tree for for
-- 
GitLab