Skip to content

Allow godot-cpp to be installable #9364

Open
godotengine/godot-cpp
#1418
@ytnuf

Description

@ytnuf

Describe the project you are working on

Currently making a GDExtension library for dammaku.

Describe the problem or limitation you are having in your project

Currently the only supported way to use godot-cpp is to use as a subproject of your project.
It kinda works but it's rather cumbersome because you need to rebuild godot-cpp when you build your project from scratch. This can be especially painful in CI.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

What this does is add an install command to the CMake script of godot-cpp.
A GDExtension project can then use find_package to use the built godot-cpp.
This makes it possible to share the compiled godot-cpp library among different project.

This also enables the usage with package-managers.

I have made a PR that would make godot-cpp installable.

godotengine/godot-cpp#1418

There are other PRs that also try to address this:

godotengine/godot-cpp#1309
godotengine/godot-cpp#1041

One of the authors would like to be able to build & install this in a docker image to save time. So this would have that benefit too.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

find_package("godot-cpp" 4.2.0 CONFIG REQUIRED)
target_link_library("my-gdextension-project" PRIVATE "godot::cpp")

If this enhancement will not be used often, can it be worked around with a few lines of script?

The work around is using godot-cpp as a subproject, but that can undesirable (unnecessary rebuilds).

Making the library installable, would mean it's a lot easier to port this to package managers.

Is there a reason why this should be core and not an add-on in the asset library?

This feature is for godot-cpp.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions