aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authormva <mva@FreeBSD.org>2012-06-20 01:18:13 +0800
committermva <mva@FreeBSD.org>2012-06-20 01:18:13 +0800
commit55aa3cf70cc354290a7d4eea482fb761d0d7caff (patch)
treec09bac6eac55dd2dbfc1fa6581306caf9c0c4d6b /Mk
parent8143375dfe019e44d5ee31ed96086a572efa4d7a (diff)
downloadfreebsd-ports-gnome-55aa3cf70cc354290a7d4eea482fb761d0d7caff.tar.gz
freebsd-ports-gnome-55aa3cf70cc354290a7d4eea482fb761d0d7caff.tar.zst
freebsd-ports-gnome-55aa3cf70cc354290a7d4eea482fb761d0d7caff.zip
- Force cmake to use PYTHON_VER as version to detect, so that it uses
the same Python version for the interpreter and library linking, if multiple Python versions are installed. PR: ports/168159 On behalf of: python@
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.python.mk11
1 files changed, 11 insertions, 0 deletions
diff --git a/Mk/bsd.python.mk b/Mk/bsd.python.mk
index a1edaf989afd..72d50ba2506d 100644
--- a/Mk/bsd.python.mk
+++ b/Mk/bsd.python.mk
@@ -676,6 +676,17 @@ RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/twisted/__init__.py:${PORTSDIR}/devel/py-twis
# XXX Hm, should I export some of the variables above to *_ENV?
+# If multiple Python versions are installed and cmake is used, it might
+# happen that a cmake-enabled port using find_package(PythonLibs) and
+# find_package(PythonInterp) detects different Python versions.
+# This in turn might cause it to link against version X while using the
+# includes of version Y, leading to a broken port.
+# Enforce a certain Python version by using PYTHON_VER for cmake.
+.if defined(USE_CMAKE)
+CMAKE_ARGS+= -DPythonLibs_FIND_VERSION:STRING="${PYTHON_VER}" \
+ -DPythonInterp_FIND_VERSION:STRING="${PYTHON_VER}"
+.endif
+
.endif # !defined(_POSTMKINCLUDED) && !defined(Python_Pre_Include)
.if defined(_POSTMKINCLUDED) && !defined(Python_Post_Include)