Skip to content

feat(juce): let JUCE projects add the module through FetchContent - #32

Merged
TobbenTM merged 1 commit into
mainfrom
juce-module-only-cmake
Sep 30, 2026
Merged

TobbenTM merged 1 commit into
mainfrom
juce-module-only-cmake

Conversation

@TobbenTM

Copy link
Copy Markdown
Member

A customer reported that a JUCE project cannot consume this repository with FetchContent_MakeAvailable on a machine without OpenSSL. The top-level CMakeLists.txt always runs find_package(OpenSSL REQUIRED), plus find_package(CURL REQUIRED) unless MOONBASE_USE_CURL is off, although the JUCE module needs neither: it verifies with Security.framework / CNG / system libcrypto and transports over juce::WebInputStream. JUCE users currently fetch the sources only and call juce_add_module() themselves.

MOONBASE_JUCE_MODULE_ONLY (off by default) adds just the moonbase_licensing module target with JUCE's juce_add_module, links juce_animation into it when that JUCE has it, and leaves out the core SDK target and everything built on it (SDK tests, examples, device id tool, bridge example, install rules). OpenSSL, CURL and nlohmann_json are never looked up. JUCE has to be added first; if juce_add_module is not defined, configure fails with a message saying so. The option is opt-in because adding the module whenever JUCE is present would collide with projects that already call MakeAvailable and then juce_add_module on the module themselves.

FetchContent_Declare(moonbase_cpp
    GIT_REPOSITORY https://github.com/Moonbase-sh/moonbase-cpp.git
    GIT_TAG v4.4.0)
set(MOONBASE_JUCE_MODULE_ONLY ON)
FetchContent_MakeAvailable(moonbase_cpp)  # after JUCE
target_link_libraries(MyPlugin PRIVATE moonbase_licensing)

To make that a single switch, CMakeLists.txt now groups every SDK-only part in one if(NOT MOONBASE_JUCE_MODULE_ONLY) block, with the JUCE section after it. Most of the diff is re-indentation, so review it with whitespace ignored. tests/juce/CMakeLists.txt now looks up OpenSSL itself (the suite signs its test tokens with it) rather than relying on the top-level lookup.

CI: juce.yml configures its matrix with -DMOONBASE_JUCE_MODULE_ONLY=ON instead of -DMOONBASE_USE_CURL=OFF (the suite never used the SDK target). A new module-only consumer job builds tests/juce_consumer_smoke, a JUCE project consuming the repository this way, with CMAKE_DISABLE_FIND_PACKAGE_OpenSSL and CMAKE_DISABLE_FIND_PACKAGE_CURL on, so any REQUIRED lookup creeping back onto that path fails the configure.

Docs: a FetchContent section in docs/juce-module.md, a pointer in the module README, and a row in the docs/core-sdk.md options table. The new GIT_TAG pin is added to scripts/bump-version.sh, to the .releaserc.json git assets and to CONTRIBUTING.md, so releases keep it current (dry-run of bump-version.sh rewrites it).

Verified locally on macOS:

  • Default configure is unchanged: core suite 112/112 passes, and install plus tests/consumer_smoke build.
  • Module-only with JUCE tests and CURL disabled: JUCE suite 60/60 passes. CMake reports the CURL and nlohmann_json disable flags as unused, confirming neither lookup ran.
  • The consumer smoke configures, builds and runs with OpenSSL and CURL disabled. With the option forced off, the same configure fails on the REQUIRED lookups, which is the reported bug.
  • Module-only without JUCE stops with the intended error.

@argos-ci

argos-ci Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Sep 30, 2026, 10:04 AM

The top-level CMakeLists always looked up OpenSSL, and CURL unless
MOONBASE_USE_CURL was off, although the JUCE module needs neither. A JUCE
project therefore could not FetchContent_MakeAvailable() this repository
on a machine without them, and had to fetch the sources and call
juce_add_module() itself.

MOONBASE_JUCE_MODULE_ONLY (off by default) adds just the moonbase_licensing
module with JUCE's juce_add_module and leaves out the core SDK target and
everything built on it, so OpenSSL, CURL and nlohmann_json are never looked
up. JUCE has to be added first; the configure says so if it was not.

The JUCE workflow now configures with the option, and a new job builds
tests/juce_consumer_smoke, a JUCE project consuming the repository this
way, with the OpenSSL and CURL lookups disabled outright.
@TobbenTM
TobbenTM force-pushed the juce-module-only-cmake branch from 179c9b9 to 1b4e318 Compare September 30, 2026 09:58
@TobbenTM
TobbenTM merged commit 1717a08 into main Sep 30, 2026
17 checks passed
github-actions Bot pushed a commit that referenced this pull request Sep 30, 2026
# [4.5.0](v4.4.1...v4.5.0) (2026-09-30)

### Features

* **juce:** let JUCE projects add the module through FetchContent ([#32](#32)) ([1717a08](1717a08))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 4.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant