Skip to content

Commit dc809c2

Browse files
API-Beasto01eg
authored andcommitted
GENERATE_TEMPLATE_GET_NODE option for CMake
1 parent 20b417f commit dc809c2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
project(godot-cpp)
3838
cmake_minimum_required(VERSION 3.6)
3939

40+
option(GENERATE_TEMPLATE_GET_NODE "Generate a template version of the Node class's get_node." ON)
41+
4042
# Change the output directory to the bin directory
4143
set(BUILD_PATH ${CMAKE_SOURCE_DIR}/bin)
4244
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${BUILD_PATH}")
@@ -131,8 +133,14 @@ else()
131133
endif()
132134

133135
# Generate source from the bindings file
136+
if(GENERATE_TEMPLATE_GET_NODE)
137+
set(GENERATE_BINDING_PARAMETERS "True")
138+
else()
139+
set(GENERATE_BINDING_PARAMETERS "False")
140+
endif()
141+
134142
message(STATUS "Generating Bindings")
135-
execute_process(COMMAND "python" "-c" "import binding_generator; binding_generator.generate_bindings(\"${GODOT_CUSTOM_API_FILE}\", True)"
143+
execute_process(COMMAND "python" "-c" "import binding_generator; binding_generator.generate_bindings(\"${GODOT_CUSTOM_API_FILE}\", ${GENERATE_BINDING_PARAMETERS})"
136144
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
137145
RESULT_VARIABLE GENERATION_RESULT
138146
OUTPUT_VARIABLE GENERATION_OUTPUT)

0 commit comments

Comments
 (0)