aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hein <jcfyecrayz@liamekaens.com>2023-09-04 16:23:06 +0000
committerLi-Wen Hsu <lwhsu@FreeBSD.org>2023-09-04 17:21:35 +0000
commitaa9736e3e5f6856f5eb5e26837169b0f6022eec8 (patch)
treed60e19312c9b9fb9c0b96e8fe935a8f185417cd4
parent86744395617a80fdbb85271db36fc4c5a7dae25d (diff)
downloadports-aa9736e3e5f6856f5eb5e26837169b0f6022eec8.tar.gz
ports-aa9736e3e5f6856f5eb5e26837169b0f6022eec8.zip
python.mk: Improve CMake/Python integration
Suport FindPython.cmake, FindPython3.cmake, FindPython2.cmake modules by adding Python{,2,3}_EXECUTABLE to CMAKE_ARGS in python.mk. CMake supports more than one way to search for python. Currently python.mk passes -DPython_ADDITIONAL_VERSIONS=${PYTHON_VER} to help FindPython{Interp,Libs}.cmake modules "find" the version of python that a port build wants to use. The FindPython{,2,3}.cmake modules don't know anything about Python_ADDITIONAL_VERSIONS but use Python{,2,3}_EXECUTABLE as the hint. PR: 262109
-rw-r--r--Mk/Uses/python.mk2
1 files changed, 2 insertions, 0 deletions
diff --git a/Mk/Uses/python.mk b/Mk/Uses/python.mk
index 179cdd2c1d0a..1665683f0827 100644
--- a/Mk/Uses/python.mk
+++ b/Mk/Uses/python.mk
@@ -771,6 +771,8 @@ CONFIGURE_ENV+= PYTHON="${PYTHON_CMD}"
# By default CMake picks up the highest available version of Python package.
# Enforce the version required by the port or the default.
CMAKE_ARGS+= -DPython_ADDITIONAL_VERSIONS=${PYTHON_VER}
+CMAKE_ARGS+= -DPython_EXECUTABLE:FILEPATH="${PYTHON_CMD}"
+CMAKE_ARGS+= -DPython${PYTHON_MAJOR_VER}_EXECUTABLE:FILEPATH="${PYTHON_CMD}"
# Python 3rd-party modules
PYGAME= ${PYTHON_PKGNAMEPREFIX}game>0:devel/py-game@${PY_FLAVOR}