-
-
Notifications
You must be signed in to change notification settings - Fork 573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make godot-cpp installable with cmake config #1418
Open
ytnuf
wants to merge
1
commit into
godotengine:master
Choose a base branch
from
ytnuf:installable
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AThousandShips
added
enhancement
This is an enhancement on the current functionality
discussion
topic:buildsystem
Related to the buildsystem or CI setup
labels
Mar 23, 2024
Please open a proposal to track the support and details of this feature, this is pretty specific and we'd need to judge the actual demand |
ytnuf
force-pushed
the
installable
branch
2 times, most recently
from
March 23, 2024 19:48
10df0ac
to
c08b93e
Compare
11 tasks
vicroms
pushed a commit
to microsoft/vcpkg
that referenced
this pull request
Jun 8, 2024
Fixes #34492 - [X] Changes comply with the [maintainer guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md). - [X] The name of the port matches an existing name for this component on https://repology.org/ if possible, and/or is strongly associated with that component on search engines. - [X] Optional dependencies are resolved in exactly one way. For example, if the component is built with CMake, all `find_package` calls are REQUIRED, are satisfied by `vcpkg.json`'s declared dependencies, or disabled with [CMAKE_DISABLE_FIND_PACKAGE_Xxx](https://cmake.org/cmake/help/latest/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.html). - [X] The versioning scheme in `vcpkg.json` matches what upstream says. - [X] The license declaration in `vcpkg.json` matches what upstream says. - [X] The installed as the "copyright" file matches what upstream says. - [X] The source code of the component installed comes from an authoritative source. - [X] The generated "usage text" is accurate. See [adding-usage](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/examples/adding-usage.md) for context. - [X] The version database is fixed by rerunning `./vcpkg x-add-version --all` and committing the result. - [X] Only one version is in the new port's versions file. - [X] Only one version is added to each modified port's versions file. Notes: - This library is static only, so it's only supported for the static triplets. - Unfortunately, godot-cpp is not yet installable, so I had to patch its cmake script. I have made a PR upstream: godotengine/godot-cpp#1418 But in the meanwhile, I have created an unofficial export target `unofficial::godot::cpp`.
ytnuf
force-pushed
the
installable
branch
2 times, most recently
from
October 13, 2024 15:53
5f31b59
to
76b3663
Compare
With #1595 restructuring the CMake code, this PR has been changed to reflect that. |
The install destination uses CMAKE_INSTALL_ so that package managers can choose the best location for these artifacts As BUILD_INTERFACE requires absolute path, this means that GODOT_GDEXTENSION_DIR needs to be an absolute path config filename can either be PascalCase or kebab-case, the latter was chosen to be consistent with the package's name (godot-cpp) string(JSON ...) is only available in cmake v3.19, as it is used to obtain the version, this means that config-version file is only created when using cmake v3.19 or later Edited the docs to include install examples
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
cmake
discussion
enhancement
This is an enhancement on the current functionality
topic:buildsystem
Related to the buildsystem or CI setup
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows this library to be installable.
For example:
A GDExtension project can use this library like so:
Reason
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.
By allowing godot-cpp to be installable one can prevent unnecessary rebuilds.
This also allows usage with a package manager (e.g vcpkg).