From c52b5d1c10616275aa6a647201702c70baae66fe Mon Sep 17 00:00:00 2001
From: Gabriel Studer <gabriel.studer@unibas.ch>
Date: Tue, 26 Nov 2019 15:03:16 +0100
Subject: [PATCH] find include directory / library for python with 'm'-suffix

This can happen if python has been compiled with a specialized
malloc.
---
 cmake_support/FindPython.cmake | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/cmake_support/FindPython.cmake b/cmake_support/FindPython.cmake
index 3a2e690de..808f0ef32 100644
--- a/cmake_support/FindPython.cmake
+++ b/cmake_support/FindPython.cmake
@@ -45,7 +45,8 @@ macro(_find_python PYTHON_ROOT VERSION)
   string(REPLACE "." "" _VERSION_NO_DOTS "${VERSION}")
   if(PYTHON_ROOT)
     find_library(PYTHON_LIBRARIES
-      NAMES "python${_VERSION_NO_DOTS}" "python${VERSION}"
+      NAMES "python${_VERSION_NO_DOTS}" "python${VERSION}" 
+      "python${_VERSION_NO_DOTS}m" "python${VERSION}m"
       HINTS "${PYTHON_ROOT}"
       PATH_SUFFIXES lib libs
       NO_SYSTEM_ENVIRONMENT_PATH NO_DEFAULT_PATH
@@ -53,17 +54,20 @@ macro(_find_python PYTHON_ROOT VERSION)
     find_path(PYTHON_INCLUDE_PATH
       NAMES Python.h
       HINTS "${PYTHON_ROOT}/include"
-      PATH_SUFFIXES include "python${_VERSION_NO_DOTS}" "python${VERSION}"
+      PATH_SUFFIXES include "python${_VERSION_NO_DOTS}" "python${VERSION}" 
+      "python${_VERSION_NO_DOTS}m" "python${VERSION}m"
       NO_SYSTEM_ENVIRONMENT_PATH NO_DEFAULT_PATH
     )
   else()
     find_library(PYTHON_LIBRARIES
-      NAMES "python${_VERSION_NO_DOTS}" "python${VERSION}"
+      NAMES "python${_VERSION_NO_DOTS}" "python${VERSION}" 
+      "python${_VERSION_NO_DOTS}m" "python${VERSION}m"
       PATH_SUFFIXES lib
     )
     find_path(PYTHON_INCLUDE_PATH
       NAMES Python.h
-      PATH_SUFFIXES include "python${_VERSION_NO_DOTS}" "python${VERSION}"     
+      PATH_SUFFIXES include "python${_VERSION_NO_DOTS}" "python${VERSION}" 
+      "python${_VERSION_NO_DOTS}m" "python${VERSION}m" 
     )    
   endif()  
 endmacro()
-- 
GitLab