[Bug 252277] cmake find_package(python3...) fails to get default python version

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu May 6 20:32:44 BST 2021


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252277

--- Comment #9 from Loïc Bartoletti <lbartoletti at FreeBSD.org> ---
Indeed, this method will search for the highest version available on the
system.

Normally, we can use the Python3_ROOT_DIR hints, but unless I misuse it, it
doesn't work properly.

cmake -DPython3_ROOT_DIR=/usr/local/lib/python3.8 should select py3.8, but
cmake continue to take the highest version available (eg. 3.9 on my system).


Another way to do this, which works well, is to use EXACT.

example:
find_package(Python3 3.6 EXACT REQUIRED COMPONENTS Interpreter Development)

One possible workaround for the ports would be to patch as I did in
Makefile_EXACT and CMakeLists_EXACT.txt

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the kde-freebsd mailing list