Skip to content

Let conan consumers turn the cli off - #620

Merged
andiwand merged 1 commit into
mainfrom
conan-with-cli
Jul 26, 2026
Merged

Let conan consumers turn the cli off#620
andiwand merged 1 commit into
mainfrom
conan-with-cli

Conversation

@andiwand

@andiwand andiwand commented Jul 26, 2026

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

Why

Follow-up to feedback from OpenDocument.ios#125:

ODR_CLI=OFF would be tidier but odrcore 5.5.0 installs the cli targets whether or not it built them — worth fixing upstream.

The install half of that is already fixed on main (ODR_INSTALL_TARGETS, since 5.7.0). What is still missing is that nothing could set ODR_CLI in the first place through conan: the recipe never passed it to CMake, so every package builds and installs meta, translate, back_translate and server — dead weight for a consumer that only links the library, and on iOS the server tool has to be linked against frameworks the app has no other use for.

What

  • conanfile.py: with_cli option, default True, wired to ODR_CLI.
  • CMakeLists.txt: install server with the other cli tools when ODR_WITH_HTTP_SERVER is on. It was being built and then dropped at install time.

The consumer-side counterpart is conan-odr-index#113 — the recipe the apps actually resolve.

Verified

Configured both ways against the existing conan toolchain and read back cmake_install.cmake:

  • -DODR_CLI=OFF → headers, libodr.a, data dir only
  • -DODR_CLI=ON -DODR_WITH_HTTP_SERVER=ONbin/meta, bin/translate, bin/back_translate, bin/server

The cli tools were built and installed with every conan package: the recipe
never passed `ODR_CLI` through, so a consumer that only links the library
(the mobile apps) had no way to skip them. Add a `with_cli` option for it.

Also install `server` alongside the other cli tools when the http server is
enabled - it was built and then dropped at install time.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xej6xnQnMAYdQ1pwTaWXxy
@andiwand
andiwand merged commit 7ade938 into main Jul 26, 2026
11 of 14 checks passed
@andiwand
andiwand deleted the conan-with-cli branch July 26, 2026 10:49
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