Skip to content

Commit 45d54b6

Browse files
committed
build: add a workaround for the build to use Python2 instead of Python3
Python3 sometimes doesn't get found, add a temporary workaround.
1 parent 66e8572 commit 45d54b6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,13 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
893893
endif()
894894

895895
find_package(Python2 COMPONENTS Interpreter REQUIRED)
896-
find_package(Python3 COMPONENTS Interpreter REQUIRED)
896+
find_package(Python3 COMPONENTS Interpreter)
897+
if(NOT Python3_Interpreter_FOUND)
898+
message(WARNING "Python3 not found, using python2 as a fallback")
899+
add_executable(Python3::Interpreter IMPORTED)
900+
set_target_properties(Python3::Interpreter PROPERTIES
901+
IMPORTED_LOCATION ${Python2_EXECUTABLE})
902+
endif()
897903

898904
#
899905
# Find optional dependencies.

0 commit comments

Comments
 (0)