-
Notifications
You must be signed in to change notification settings - Fork 32
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 Cubos compatible with CMake find_package #1327
Make Cubos compatible with CMake find_package #1327
Conversation
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1327 +/- ##
===========================================
+ Coverage 41.94% 54.23% +12.29%
===========================================
Files 441 438 -3
Lines 33129 25338 -7791
Branches 3872 2347 -1525
===========================================
- Hits 13895 13742 -153
+ Misses 19234 11596 -7638 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
528aa87
to
1a572b1
Compare
1a572b1
to
0e47178
Compare
b079992
to
903fb18
Compare
1b25f44
to
fc4ca73
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang-Tidy
found issue(s) with the introduced code (1/1)
fc4ca73
to
c9db46e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand much about CMake so I can't really comment on the code itself, however by the description seems like a great QoL update for both devs and users!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works on my machine LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!
This commit is a big one, and it does a lot of stuff. Sorry for not breaking it up further. I didn't work on this in a very structured way because the solution wasn't clear at the beginning. This commit does the following things: - Makes Cubos find_package compatible. This means that now, Cubos can be installed by building the 'install' target, and can then be used in other projects (e.g. cubos-demo) through find_package(cubos), which is great, and way more standard! - Replaces all git submodules by CMake calls to FetchContent. Internally, FetchContent may end up creating git submodules, but the whole process is hidden from the user. I decided to change to this system because submodule integrate very badly with find_package, and I wasn't able to get it working. Also, I think everyone is tired of messing around with submodules, so this is a big QOL plus. - Make the process of deploying Cubos applications way easier. Tesseratos is an example of this - it can now be installed with the 'install' target! Basically I just setup some 'wiring' to make it possible to either pick the assets folder from the development source directory, or from the current directory. The latter is what we want when we're deploying. - A very big cleanup on the whole CMake config, making it nicer to read and more organized, with proper comments. This was pretty much necessary to get the other things done.
5153fc8
to
67a2023
Compare
Description
I tried to quickly give this a shot for 0.4 but it was way more complex than I anticipated.
I ended up needing to refactor pretty much the whole CMake configuration, as dealing with two libs at once (engine and core), plus their dependencies, of which some are obtained from add_subdirectory instead of find_package, was a big pain.
Sorry for not breaking this PR up further. I didn't work on this in a very structured way because the solution wasn't clear from the beginning. To sum it up, this PR achieves the following:
Makes Cubos find_package compatible. This means that now, Cubos can be installed by building the 'install' target, and can then be used in other projects (e.g. cubos-demo) through find_package(cubos), which is great, and way more standard!
Replaces all git submodules by CMake calls to FetchContent. Internally, FetchContent may end up creating git submodules, but the whole process is hidden from the user. I decided to change to this system because submodule integrate very badly with find_package, and I wasn't able to get it working. Also, I think everyone is tired of messing around with submodules, so this is a big QOL plus.
Make the process of deploying Cubos applications way easier. Tesseratos is an example of this - it can now be installed with the 'install' target! Basically I just setup some 'wiring' to make it possible to either pick the assets folder from the development source directory, or from the current directory. This can be toggled with the
TESSERATOS_DISTRIBUTE
option. The latter is what we want when we're deploying.A very big cleanup on the whole CMake config, making it nicer to read and more organized, with proper comments. This was pretty much necessary to get the other things done.
One final thing: to put this all to test, I packaged Cubos with Nix! Maybe we can get it on nixpkgs on the next update 👀
Checklist