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

CMake: Alleviate target name clashes, visibility, and grouping. #1658

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

enetheru
Copy link
Contributor

This PR resolves CMake name clashes #1657, Partially resolves optionally disable targets #1650, and tidies IDE usage for VS and XCode by grouping targets under a subfolder.

  • Rename CMake internal targets from to godot-cpp., Aliases will remain godot-cpp::
  • Simplify _generate cmake function signature, as TARGET_ALIAS and TARGET_NAME are still in scope and do not need to be passed.
  • Add GODOT_ENABLE_TESTING option default OFF, and guard add_subdirectory( test ) by default
  • Add global property USE_FOLDERS ON and target property FOLDER "godot-cpp" to group targets in VS and XCode

@Torets
Copy link

Torets commented Nov 27, 2024

The thing GODOT_ENABLE_TESTING somewhat clashes with my PR #1650, I also guard add_subdirectory( test ), but with GODOT_CPP_USE_TEST that is ON by default. I failed to mention it in PR description, sorry.
I'll remove it from my PR to avoid future merging conflicts.

@enetheru
Copy link
Contributor Author

The thing GODOT_ENABLE_TESTING somewhat clashes with my PR #1650

Indeed it does clash, perhaps it needs its own PR, if either of our PR's get merged, the other can rebase and fix. I thought about splitting this into three parts, but I dont know how fine grained PR's should be.

Torets added a commit to Torets/godot-cpp-optional-targetss that referenced this pull request Nov 27, 2024
@Torets
Copy link

Torets commented Nov 27, 2024

I've reverted my changes for now. yours seem to better in terms of naming, description of PR and placement of option.

@enetheru enetheru force-pushed the name_clash branch 2 times, most recently from e2e79f8 to 9d74b0e Compare November 27, 2024 21:56
Simplify <platform>_generate cmake function signature, as TARGET_ALIAS and TARGET_NAME are still in scope and do not need to be passed.

Add USE_FOLDERS, and FOLDER properties to group targets in VS and XCode

Guard test target with GODOT_ENABLE_TESTING
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