[GDExtension/CMake] Add shared Godot/Godot-cpp CMakeFile for use via FetchContent #11400
LouChiSoft
started this conversation in
General Discussions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I know CMake support is new and isn't as mature as SCons, but as it get better I think more people are going to prefer it over SCons. Right now from my experience if I want to make a GDExtension with CMake I need to manually get, build and run a matching version of Godot to dump the extension_api.json to then pass it into the godot-cpp CMakeLists for making the GDExtension.
My proposal is a sort of CMake based "glue file". The idea would be that you can use via methods like FetchContent and gets and builds both the Godot engine and the godo-cpp library. It would sync the settings between the projects, precision, engine version, etc. and provide a target for the godot engine being built for a convenient way to test the GDExtension being developed.
In theory if done well, the user could include the CMakeLists.txt then using a custom command add targets for each combination of engine settings. e.g. one target for single precision and one target for double precision, as well as generating a gdextension file based on the outputs of the project. Also a user updating a GDExtension would be as simple as updating the branch that is used to build Godot and godot-cpp.
Pseudo-code example usage:
Beta Was this translation helpful? Give feedback.
All reactions