-
Notifications
You must be signed in to change notification settings - Fork 21
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 Fixes #1062
CMake Fixes #1062
Conversation
204914f
to
c3aea7f
Compare
619360f
to
9675c95
Compare
I've got a fix for source groups in place for examples, which always uses the defualt CMAke In this case, the fiules If they are a child, then a dir would also be applied, i.e. This shows the application_icon rc being placed together, rather than being the only thing in @Robadob If you're happy with this prefixing src with I will push it with the examples showing it now behaving correctly in the erranous cases, but a couple of commits will then want dropping prior to merge as they add examples that are not really examples. Unit testing CMake stuff is not something we're set up for. |
9675c95
to
4ef0671
Compare
I've no strong preference, removing the redundant |
For examples we can't really do that, as the src dir may not exist (which could cause errors / issues with the source grouping before) and would then potentially cause folder conflicts, if say the user had this (unwise) setup
Then intentionally removing src would cause both We probably could for the flamegpu target, but its probably simpler / more consistent to keep it. I'll make the change when I'm back in windows at some point. The CI failure is just from my low-effort testing of the folder structures / CMake, so once I drop the appropraite commit it pass. |
As I said, no strong preference do what you think best. It's hard to go wrong. |
4ef0671
to
1ddd06c
Compare
I've now made the source_group change to the FLAMEGPU target, so that it places things into the CMake default filters of This makes it nest deeper, but is consistent. I'm not strongly opinionated either way, so if you don't like this we can drop the final commit and still merge this anyway. I've also removed the example(s) which showed the previous CMake failures, as they were messy and I'm not aware of a nice way to have a CMake test suite. I have pushed them to another branch Otherwise this PR is ready for review. |
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.
CMake: Demonstrate use of flamegpu_add_library on the host_fucntions example. Maybe don't merge?
Would require example readme discussing, or delete commit.
Rest of the commits look fine, though I didn't really fully process the changes to the static lib refactor the diff was a bit of a mess.
1ddd06c
to
31ef1e4
Compare
…main CMake project I.e. linting flamegpu2 is not relevant to consumers of this repo via add_subdirectory, so only make the target if a user explicitly requests it Closes #1045
…ts.txt This does change the filters to always place things in 'Header Files' and 'Source Files', matching CMake's implicit placement of application_icon.rc in 'Source Files'. If files are above the CMakeLists.txt, they are just flat placed in the appropraite header / source files filter
31ef1e4
to
4f3a898
Compare
I've now dropped the missed "probably don't merge" commit, which was just a test case demonstrating the library use case rather than binary. I'll open an issue to document it on the docs repo and / or use it in a standalone example in the future too. rebased onto current master as well. |
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
A number of fixes and additions to FLAMEGPU2's CMake encountered when working on a more complex tempalte model.
flamegpu_new_linter_target
fix. Closes CMake: flamegpu_new_linter_target uses PROJECT_NAME not NAME #1057lint_flamegpu
target OFF by default when this repo is not he primary CMake. Closes CMake: makelint_flamegpu
optional / not part ofall_lint
when included #1045docs
target OFF by default when this repo is not primaryflamegpu_add_library
, for creating static libraries which are more than just linked against FLAMEGPU2 (i.e. warning levels MSVC + CUDA fixes etc. This allows the creation of unit-testable FLAMEGPU 2 simulators.flamegpu_add_library
in an existing example. This may not actually be desirable for merging.source_group
errors, Closes CMakeflamegpu_add_executable
source_group
errors #1051. Tested on windows.++
still work (I.e. check I don't break CMake: Escape user-provided regex patterns. #1085 during a rebase)