sudara / melatonin_inspector

A JUCE module that gives you the ability to inspect and visually edit (non-destructively) components in your UI.
MIT License
156 stars 18 forks source link

Trouble with FetchContent #60

Closed chrhaase closed 1 year ago

chrhaase commented 1 year ago

Hi and thanks for this great piece of work! Very helpful :)

I went the FetchContent way when adding this to my project, but got an error at this line, because FetchContent will by default add a "-src" suffix to the name of the directory.

I could resolve this by adding a specific directory name like this:

include (FetchContent)

FetchContent_Declare (melatonin_inspector
  GIT_REPOSITORY https://github.com/sudara/melatonin_inspector.git
  GIT_TAG origin/main
  SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/melatonin_inspector)

FetchContent_MakeAvailable (melatonin_inspector)

target_link_libraries (yourTarget PRIVATE Melatonin::Inspector)

My apologies if this is somehow specific to my project!

sudara commented 1 year ago

Hey @chrhaase! Glad you could try it out! Please feel free to open issues with random features/thoughts, etc, I'm like 100% on this project at the moment :)

Sorry you had install trouble. I see the problem. I guess that's why we stuck the module files in a redundant folder for my other cmake friendly module melatonin_perfetto

I think I'll steal your solution for now and update the README so I don't have to bury the module code. Thank you!

chrhaase commented 1 year ago

Yes, I was just about to suggest a module folder hehe. That would also potentially help folks naming the submodule folder something else.

Hey @chrhaase! Glad you could try it out! Please feel free to open issues with random features/thoughts, etc, I'm like 100% on this project at the moment :)

And great, I will! :)

sudara commented 1 year ago

That would also potentially help folks naming the submodule folder something else.

Out of curiosity would you want to do that, you think? I usually make the assumption people are sticking things in modules/exact_module_name but I've noticed other people publishing modules can be looser about naming conventions too...

chrhaase commented 1 year ago

Yes, I'd love to - think I can manage before the weekend :)