Skip to content
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

Add CMake preset and VSCode support #61

Merged
merged 3 commits into from
Sep 27, 2023

Conversation

kelteseth
Copy link
Contributor

@kelteseth kelteseth commented Aug 31, 2023

With this we are now able to open this project in VSCode and QtCreator and other IDEs that support CMakePresets. No laborious setup required.

6S2ubHsZg5.mp4

This is a MVP MR. We easily can add more features like VCPKG support with a few lines.

With this we are now able to open this project in
VSCode and QtCreator and other IDEs that support
CMakePresets.

Add launch.json can can be further edited to also launch
godot editor

Add tasks.json for the build step. This can also be used
in combination with TaskRunner
https://marketplace.visualstudio.com/items?itemName=SanaAjani.taskrunnercode
for on click tasks (like formatting or custom deploy scripts). I use this
extensivly in ScreenPlay see
https://gitlab.com/kelteseth/ScreenPlay/-/blob/master/.vscode/tasks.json?ref_type=heads

Add godot.natvis for better debugger support

Add extensions.json that recommends cmake and cpp support for now. We
maybe should also add godot related extentions here.
Copy link
Owner

@asmaloney asmaloney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Elias!

I tried using VSCode at one point but found it too messy with all the config and the way you run stuff, so I went back to Qt Creator.

I haven't used CMake presets before. I looked at them when they were released, but there were too many issues. I would guess they've sorted them out by now, so that's a good addition.

Are you willing to answer questions/fix this stuff when it breaks? 😄

.vscode/launch.json Show resolved Hide resolved
CMakePresets.json Outdated Show resolved Hide resolved
CMakePresets.json Show resolved Hide resolved
@kelteseth
Copy link
Contributor Author

kelteseth commented Sep 1, 2023

Are you willing to answer questions/fix this stuff when it breaks? 😄

Sure! I'm away for the weekend so I will report back Sunday 👍

@kelteseth
Copy link
Contributor Author

Ready :)

@asmaloney
Copy link
Owner

This still looks like it's build/launch only for debug.

Don't we need build presets and launch targets for release builds too?

@kelteseth
Copy link
Contributor Author

kelteseth commented Sep 12, 2023

I'm currently on vacation for the next two weeks, I will look into it afterwards :)

@asmaloney
Copy link
Owner

No problem at all. Have an amazing break!

Change binary dir path to use same folder
name as Godot for os and inset project
name into folder name
@asmaloney asmaloney changed the title Add CMake preset support Add CMake preset and VSCode support Sep 27, 2023
Copy link
Owner

@asmaloney asmaloney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Elias!

@asmaloney asmaloney merged commit e3bfbe4 into asmaloney:master Sep 27, 2023
@kelteseth
Copy link
Contributor Author

This can still be improved. I'm currently using an altered version for my personal project ScreenPlay (Godot desktop wallpaper) here https://gitlab.com/kelteseth/ScreenPlay/-/merge_requests/108

For example, not sure if we need the launch.json because there is nothing to launch when running the project, because this only compiles the library. This still can be altered to include the Godot editor to start the project.

Also in ScreenPlay I embed the project and explicitly set the build folder to my Godot project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants