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

How to add using FetchContent or CPM? #48

Open
adamski opened this issue Mar 10, 2024 · 3 comments
Open

How to add using FetchContent or CPM? #48

adamski opened this issue Mar 10, 2024 · 3 comments

Comments

@adamski
Copy link

adamski commented Mar 10, 2024

Is it possible to add a gin module via FetchContent or CPM?

I prefer this method over Git submodules.

@FigBug
Copy link
Owner

FigBug commented Mar 10, 2024

Maybe take a look at this project, they don't use submodules: https://github.com/stfufane/Midi-Transposer/blob/main/CMakeLists.txt

@stfufane
Copy link
Contributor

Yeah it works like I did by using the SOURCE_SUBDIR argument to fetch the modules directory instead of the root folder, otherwise you get conflicts.

@adamski
Copy link
Author

adamski commented Mar 13, 2024

I got it working like this:

CPMAddPackage(NAME Gin
        GITHUB_REPOSITORY FigBug/Gin
        DOWNLOAD_ONLY TRUE
        GIT_TAG master)

juce_add_module(${Gin_SOURCE_DIR}/modules/gin)
juce_add_module(${Gin_SOURCE_DIR}/modules/gin_graphics)
...

This enables me to only add the modules I need.

@FigBug Can I suggest to add this to the README?

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

No branches or pull requests

3 participants