From 2989a385d759d9ef229c50fc2b1ee09d622918df Mon Sep 17 00:00:00 2001 From: Manuel Riecke Date: Sun, 20 Sep 2020 12:18:42 +0200 Subject: [PATCH] GENERATE_TEMPLATE_GET_NODE option for CMake --- CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e3ef88d..5fb70cb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,6 +37,8 @@ project(godot-cpp) cmake_minimum_required(VERSION 3.6) +option(GENERATE_TEMPLATE_GET_NODE "Generate a template version of the Node class's get_node." ON) + # Change the output directory to the bin directory set(BUILD_PATH ${CMAKE_SOURCE_DIR}/bin) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${BUILD_PATH}") @@ -131,8 +133,14 @@ else() endif() # Generate source from the bindings file +if(GENERATE_TEMPLATE_GET_NODE) + set(GENERATE_BINDING_PARAMETERS "True") +else() + set(GENERATE_BINDING_PARAMETERS "False") +endif() + message(STATUS "Generating Bindings") -execute_process(COMMAND "python" "-c" "import binding_generator; binding_generator.generate_bindings(\"${GODOT_CUSTOM_API_FILE}\", True)" +execute_process(COMMAND "python" "-c" "import binding_generator; binding_generator.generate_bindings(\"${GODOT_CUSTOM_API_FILE}\", ${GENERATE_BINDING_PARAMETERS})" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} RESULT_VARIABLE GENERATION_RESULT OUTPUT_VARIABLE GENERATION_OUTPUT)