FigBug / Gin

A few extras for juce
BSD 3-Clause "New" or "Revised" License
262 stars 40 forks source link

How to add using FetchContent or CPM? #48

Open adamski opened 8 months ago

adamski commented 8 months ago

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

I prefer this method over Git submodules.

FigBug commented 8 months ago

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

stfufane commented 8 months ago

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 commented 8 months ago

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?