77#
88macro (find_python_from_executable EXECUTABLE SUPPORTED_VERSIONS )
99 file (REAL_PATH ${EXECUTABLE} EXECUTABLE )
10- set (Python_EXECUTABLE ${EXECUTABLE} )
11- find_package (Python COMPONENTS Interpreter Development.Module Development.SABIModule )
12- if (NOT Python_FOUND )
10+ set (Python3_EXECUTABLE ${EXECUTABLE} )
11+ find_package (Python3 COMPONENTS Interpreter Development.Module Development.SABIModule )
12+ if (NOT Python3_FOUND )
1313 message (FATAL_ERROR "Unable to find python matching: ${EXECUTABLE} ." )
1414 endif ()
15- set (_VER "${Python_VERSION_MAJOR } .${Python_VERSION_MINOR } " )
15+ set (_VER "${Python3_VERSION_MAJOR } .${Python3_VERSION_MINOR } " )
1616 set (_SUPPORTED_VERSIONS_LIST ${SUPPORTED_VERSIONS} ${ARGN} )
1717 if (NOT _VER IN_LIST _SUPPORTED_VERSIONS_LIST)
1818 message (FATAL_ERROR
@@ -30,7 +30,7 @@ endmacro()
3030function (run_python OUT EXPR ERR_MSG )
3131 execute_process (
3232 COMMAND
33- "${Python_EXECUTABLE } " "-c" "${EXPR} "
33+ "${Python3_EXECUTABLE } " "-c" "${EXPR} "
3434 OUTPUT_VARIABLE PYTHON_OUT
3535 RESULT_VARIABLE PYTHON_ERROR_CODE
3636 ERROR_VARIABLE PYTHON_STDERR
@@ -89,7 +89,7 @@ function (hipify_sources_target OUT_SRCS NAME ORIG_SRCS)
8989
9090 add_custom_target (
9191 hipify${NAME}
92- COMMAND "${Python_EXECUTABLE } " ${CMAKE_SOURCE_DIR } /cmake/hipify.py -p ${CMAKE_SOURCE_DIR } -o ${CMAKE_CURRENT_BINARY_DIR } ${SRCS}
92+ COMMAND "${Python3_EXECUTABLE } " ${CMAKE_SOURCE_DIR } /cmake/hipify.py -p ${CMAKE_SOURCE_DIR } -o ${CMAKE_CURRENT_BINARY_DIR } ${SRCS}
9393 DEPENDS ${CMAKE_SOURCE_DIR } /cmake/hipify.py ${SRCS}
9494 BYPRODUCTS ${HIP_SRCS}
9595 COMMENT "Running hipify on ${NAME} extension source files." )
@@ -505,9 +505,9 @@ function (define_gpu_extension_target GPU_MOD_NAME)
505505 endif ()
506506
507507 if (GPU_USE_SABI)
508- Python_add_library (${GPU_MOD_NAME} MODULE USE_SABI ${GPU_USE_SABI} ${GPU_WITH_SOABI} "${GPU_SOURCES} " )
508+ Python3_add_library (${GPU_MOD_NAME} MODULE USE_SABI ${GPU_USE_SABI} ${GPU_WITH_SOABI} "${GPU_SOURCES} " )
509509 else ()
510- Python_add_library (${GPU_MOD_NAME} MODULE ${GPU_WITH_SOABI} "${GPU_SOURCES} " )
510+ Python3_add_library (${GPU_MOD_NAME} MODULE ${GPU_WITH_SOABI} "${GPU_SOURCES} " )
511511 endif ()
512512
513513 if (GPU_LANGUAGE STREQUAL "HIP" )
0 commit comments