Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
I'm not a fan of SCons, so I updated the CMake build script in my own fork of godot-cpp and added some convenience features as well. This library can be used via FetchContent as a subproject or by building and installing it as a package. Once acquired, you just need to link your library to the godot::cpp target. Then simply to write your GDNative classes and install the target into the project directory (preferably into a res://bin folder or something similar) of your godot project using the custom install_gdnlib function.
There is an installation script that will be created by install_gdnlib that will handle creating all the necessary files for using the gdnative library automatically. You can see an easy example of this in my fork of the gdnative_cpp_example repo. The cmake script in that repo also has some extra information about the process.
In 4.0 this will work as you described without a fork after this branch is merged: https://github.com/godotengine/godot-cpp/pull/602