Merge pull request #675 from Ivorforce/patch-2

pull/808/head
Hugo Locurcio 2022-01-26 18:47:13 +01:00 committed by GitHub
commit b9b606d271
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -115,20 +115,20 @@ else()
endif() endif()
# Generate source from the bindings file # Generate source from the bindings file
find_package(PythonInterp 3.4 REQUIRED) # pathlib should be present find_package(Python3 3.4 REQUIRED) # pathlib should be present
if(GENERATE_TEMPLATE_GET_NODE) if(GENERATE_TEMPLATE_GET_NODE)
set(GENERATE_BINDING_PARAMETERS "True") set(GENERATE_BINDING_PARAMETERS "True")
else() else()
set(GENERATE_BINDING_PARAMETERS "False") set(GENERATE_BINDING_PARAMETERS "False")
endif() endif()
execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" "import binding_generator; binding_generator.print_file_list(\"${GODOT_CUSTOM_API_FILE}\", \"${CMAKE_CURRENT_BINARY_DIR}\", headers=True, sources=True)" execute_process(COMMAND "${Python3_EXECUTABLE}" "-c" "import binding_generator; binding_generator.print_file_list(\"${GODOT_CUSTOM_API_FILE}\", \"${CMAKE_CURRENT_BINARY_DIR}\", headers=True, sources=True)"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE GENERATED_FILES_LIST OUTPUT_VARIABLE GENERATED_FILES_LIST
) )
add_custom_command(OUTPUT ${GENERATED_FILES_LIST} add_custom_command(OUTPUT ${GENERATED_FILES_LIST}
COMMAND "${PYTHON_EXECUTABLE}" "-c" "import binding_generator; binding_generator.generate_bindings(\"${GODOT_CUSTOM_API_FILE}\", \"${GENERATE_BINDING_PARAMETERS}\", \"${CMAKE_CURRENT_BINARY_DIR}\")" COMMAND "${Python3_EXECUTABLE}" "-c" "import binding_generator; binding_generator.generate_bindings(\"${GODOT_CUSTOM_API_FILE}\", \"${GENERATE_BINDING_PARAMETERS}\", \"${CMAKE_CURRENT_BINARY_DIR}\")"
VERBATIM VERBATIM
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
MAIN_DEPENDENCY ${GODOT_CUSTOM_API_FILE} MAIN_DEPENDENCY ${GODOT_CUSTOM_API_FILE}