Description: Choose installation of Python modules into PythonX/dist-packages over PythonX.Y/dist-packages
Author: James Turton <james@somecomputer.xyz>
Last-Update: 2020-04-10
--- a/cmake/TulipPython.cmake
+++ b/cmake/TulipPython.cmake
@@ -20,11 +20,11 @@
 import site
 import sys
 from distutils.sysconfig import get_python_lib
-py_version = str(sys.version_info[0]) + '.' + str(sys.version_info[1])
+py_version = str(sys.version_info[0]) # + '.' + str(sys.version_info[1])
 if sys.version_info >= (2, 7):
   for path in site.getsitepackages():
     # check that we select a valid install path
-    if path.startswith('${CMAKE_INSTALL_PREFIX}') and py_version in path:
+    if path.startswith('${CMAKE_INSTALL_PREFIX}') and '/python{}/'.format(py_version) in path:
       # avoid to install in /usr/local when CMAKE_INSTALL_PREFIX is /usr on debian
       if '${CMAKE_INSTALL_PREFIX}' == '/usr' and '/usr/local' in path:
         continue
