From e782eb86e9cce3f529909e98a7c5f0ae05d5d672 Mon Sep 17 00:00:00 2001 From: Dean Moldovan Date: Sun, 12 Jun 2016 00:37:56 +0200 Subject: [PATCH] Skip FindPythonLibsNew if PYTHONLIBS_FOUND is defined (fix #236) Also: - Update documented result variables - Remove long-ago-deprecated variable --- tools/FindPythonLibsNew.cmake | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tools/FindPythonLibsNew.cmake b/tools/FindPythonLibsNew.cmake index c80432a58..bfc865c8f 100644 --- a/tools/FindPythonLibsNew.cmake +++ b/tools/FindPythonLibsNew.cmake @@ -7,14 +7,11 @@ # PYTHON_PREFIX - path to the Python installation # PYTHON_LIBRARIES - path to the python library # PYTHON_INCLUDE_DIRS - path to where Python.h is found +# PYTHON_MODULE_EXTENSION - lib extension, e.g. '.so' or '.pyd' +# PYTHON_MODULE_PREFIX - lib name prefix: usually an empty string # PYTHON_SITE_PACKAGES - path to installation site-packages # PYTHON_IS_DEBUG - whether the Python interpreter is a debug build # -# PYTHON_INCLUDE_PATH - path to where Python.h is found (deprecated) -# -# A function PYTHON_ADD_MODULE( src1 src2 ... srcN) is defined -# to build modules for python. -# # Thanks to talljimbo for the patch adding the 'LDVERSION' config # variable usage. @@ -53,6 +50,9 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #============================================================================= +if(PYTHONLIBS_FOUND) + return() +endif() # Use the Python interpreter to find the libs. if(PythonLibsNew_FIND_REQUIRED) @@ -165,10 +165,6 @@ else() endif() endif() -# For backward compatibility, set PYTHON_INCLUDE_PATH, but make it internal. -SET(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}" CACHE INTERNAL - "Path to where Python.h is found (deprecated)") - MARK_AS_ADVANCED( PYTHON_LIBRARY PYTHON_INCLUDE_DIR