Gin icon indicating copy to clipboard operation
Gin copied to clipboard

How to add using FetchContent or CPM?

Open adamski opened this issue 1 year ago • 3 comments

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

I prefer this method over Git submodules.

adamski avatar Mar 10 '24 21:03 adamski

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

FigBug avatar Mar 10 '24 22:03 FigBug

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.

stfufane avatar Mar 11 '24 07:03 stfufane

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?

adamski avatar Mar 13 '24 14:03 adamski