Skip to content

Commit 806b792

Browse files
authored
Update CMakeLists.txt to detect Python installation better
1 parent 504267d commit 806b792

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,9 @@ endif()
284284
# Find SWIG
285285
find_package(SWIG 4.0 COMPONENTS python)
286286
if(SWIG_FOUND)
287+
# https://discourse.cmake.org/t/find-package-python3-is-not-finding-the-correct-python/10563/8
288+
set(Python3_FIND_STRATEGY LOCATION)
289+
set(Python3_FIND_UNVERSIONED_NAMES FIRST)
287290
find_package(Python3 COMPONENTS Interpreter Development)
288291
if(PYTHON3_FOUND)
289292
set(HAVE_SWIG 1)

0 commit comments

Comments
 (0)