Skip to content

feat: package as Conan recipe with plotjuggler_core:: CMake components#89

Open
facontidavide wants to merge 4 commits into
mainfrom
feature/conan-package
Open

feat: package as Conan recipe with plotjuggler_core:: CMake components#89
facontidavide wants to merge 4 commits into
mainfrom
feature/conan-package

Conversation

@facontidavide
Copy link
Copy Markdown
Contributor

Summary

  • Renames the installable CMake package from PlotJugglerSDK to plotjuggler_core, with audience-aligned components: base, datastore, plugin_sdk (plugin authors), plugin_host (host loaders).
  • Adds conanfile.py so downstream projects (e.g. pj-official-plugins) can resolve via find_package(plotjuggler_core REQUIRED COMPONENTS plugin_sdk) + requires plotjuggler_core/1.0.0 instead of pulling source through CPM.
  • Ships PjPluginManifest.cmake alongside the package via cmake_build_modules, so pj_emit_plugin_manifest() is available to consumers without copying the helper.

Why

pj-official-plugins currently pulls plotjuggler_core source via CPMAddPackage and builds it in-tree on every consumer build. That works, but it forecloses on binary caching, version pinning via Conan, and consumption from non-CPM build systems. The existing PJ_INSTALL_SDK=ON path only installed pj_base (mis-named DataSource) + pj_dialog_sdk (Dialog) — too narrow to support a plugin author, and the names collide with the DataSource plugin family.

This PR closes both gaps.

Components and audiences

Component Audience Pulls in
plotjuggler_core::base always available pj_base
plotjuggler_core::datastore optional (with_datastore) pj_datastore + fmt + tsl-robin-map + nanoarrow
plotjuggler_core::plugin_sdk plugin authors (default) pj_base + pj_dialog_sdk + pj_plugin_sdk headers + nlohmann_json + auto-loaded pj_emit_plugin_manifest()
plotjuggler_core::plugin_host host app + test rigs (with_host) every pj_*_host loader + catalogs + pj_dialog_library

pj_dialog_protocol is exported as an internal target but transitively reachable through plugin_sdk and plugin_host — not advertised as a public component.

Consumer example (post-merge usage)

find_package(plotjuggler_core REQUIRED COMPONENTS plugin_sdk)
add_library(my_plugin SHARED my_plugin.cpp)
target_link_libraries(my_plugin PRIVATE plotjuggler_core::plugin_sdk)
pj_emit_plugin_manifest(my_plugin FAMILY data_source MANIFEST_FILE manifest.json)
# conanfile.py
requires = ("plotjuggler_core/1.0.0",)

Notable mechanical changes

  • All exported targets now use BUILD_INTERFACE/INSTALL_INTERFACE include directories (required for the EXPORT to survive install).
  • Created a new pj_plugin_host INTERFACE umbrella that aggregates all host loaders.
  • Extended pj_plugin_sdk INTERFACE umbrella to also bundle pj_dialog_sdk so plugin authors link one target.
  • Installed pj_plugins/include/, pj_datastore/include/, and pj_plugins/dialog_protocol/include/ trees; previously dialog headers were installed via explicit install(FILES ...).
  • cmake/PjPluginManifest.cmake now include(GNUInstallDirs) itself so consumers don't have to.
  • conanfile.txt removed (replaced by conanfile.py which handles both packaging and local dev via with_tests / with_parquet_example options).

Test plan

  • ./build.sh — full in-tree RelWithDebInfo build passes
  • ./test.sh — 48/48 tests pass
  • ./test_sdk_install.sh — installs, all four components resolve via find_package, examples/sdk_consumer builds + emits manifest sidecar
  • conan create . — recipe builds and packages cleanly
  • Out-of-tree Conan consumer (conanfile.txt: requires plotjuggler_core/1.0.0) resolves and finds all components
  • pj-official-plugins migration from CPM to find_package(plotjuggler_core) + requires plotjuggler_core/1.0.0 (follow-up PR)
  • Docs update (README, USER_GUIDE) for the new package layout (follow-up)
  • Publish to a Conan remote (cloudsmith?) once a tagged release lands

🤖 Generated with Claude Code

Davide Faconti and others added 4 commits May 17, 2026 10:26
Renames the installable CMake package from PlotJugglerSDK to plotjuggler_core,
restructures install targets into four audience-aligned components, and adds a
Conan 2 recipe so downstream projects (e.g. pj-official-plugins) can resolve
plotjuggler_core via `find_package` + `requires` instead of CPM source pulls.

Components:
  base         - vocabulary types (pj_base, always available)
  datastore    - columnar engine (option: with_datastore)
  plugin_sdk   - umbrella for plugin authors (pj_base + pj_dialog_sdk + parser
                 SDK); ships PjPluginManifest.cmake via cmake_build_modules
  plugin_host  - umbrella for host loaders (option: with_host)

Usage:
  find_package(plotjuggler_core REQUIRED COMPONENTS plugin_sdk)
  target_link_libraries(my_plugin PRIVATE plotjuggler_core::plugin_sdk)

Verified: ./build.sh + 48/48 tests, ./test_sdk_install.sh (all 4 components
resolve via find_package, sdk_consumer example emits manifest sidecar),
`conan create .` packages cleanly, and an out-of-tree Conan consumer can
link plotjuggler_core::{base,datastore,plugin_sdk,plugin_host}.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bumps the placeholder 1.0.0 version (carried over from PJ_SDK_VERSION) to
0.1.0 as the first published release of the plotjuggler_core Conan package
and installable CMake package.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…itHub Release

Triggered by pushing a v* tag (or manually via workflow_dispatch). Verifies
the conanfile.py version matches the tag, builds the package with
`conan create`, uploads it to the project's Cloudsmith remote, and publishes
a GitHub Release with install instructions.

Requires repo secrets:
  CLOUDSMITH_USER     — Cloudsmith username
  CLOUDSMITH_API_KEY  — Cloudsmith API key with write access

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…moved)

The Windows CI step `Compute Conan cache tag` was hashing conanfile.txt by
name, which broke after the file was replaced by conanfile.py. Switch the
Windows hash input to conanfile.py and broaden the Linux find to match
either filename so subtree conanfile.txt files (e.g. pj_ported_plugins/)
continue to influence the cache key.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

1 participant