[Enhancement] Add an installable CMake library package

Open
#12 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
cmake, cpp
Domain
build-system

Research direction

Start in CMakeLists.txt, which defines caraxes_elf, caraxes_disasm, caraxes_analysis, caraxes_decompiler and the CLI targets but has no install() or export rules, then read the public headers that expose elf::parse_file, disasm::disassemble and analysis::analyze. Done means a temporary-prefix install works, find_package(Caraxes CONFIG REQUIRED) resolves the namespaced targets, a consumer example builds against the installed package, and the in-tree build and CLI executables still pass.

Written by the indexing model from the issue text.

Description

enhancement

Summary

Provide an installable CMake package and documented reusable-library API so applications can embed Caraxes without copying the repository or linking against build-tree paths.

Current state

CMakeLists.txt defines the layered libraries (caraxes_elf, caraxes_disasm, caraxes_analysis, and caraxes_decompiler) and CLI executables, but it has no install() rules, exported targets, package configuration, installed public headers, or consumer example. The README documents only in-tree build outputs under build/.

The public headers already expose useful value types and entry points, including elf::parse_file, disasm::disassemble, and analysis::analyze, so downstream tooling currently has to depend on the source layout and build directory.

Proposed capability

Add a supported installation and packaging surface:

  • Install CLI binaries and public headers under standard prefixes.
  • Export namespaced targets such as Caraxes::ELF, Caraxes::Disasm, Caraxes::Analysis, and Caraxes::Decompiler.
  • Generate a versioned CaraxesConfig.cmake/CaraxesConfigVersion.cmake package, with Capstone represented as a transitive dependency.
  • Provide a clear static/shared-library option and preserve the existing command-line targets.
  • Separate or document stable public headers from implementation-only headers.
  • Add a minimal external-consumer example that loads an ELF, disassembles a section, and runs analysis.

Acceptance criteria

  • A clean external project can run find_package(Caraxes CONFIG REQUIRED) and link a documented target without referring to the source or build tree.
  • The installed package works with both a system Capstone installation discovered through the package configuration and the supported fallback discovery path.
  • Installed headers and exported targets match the documented API and version.
  • CI/test coverage installs the package into a temporary prefix and builds the consumer example against it.
  • Existing in-tree builds and all three CLI executables continue to work.
Dominant language
C++
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TiElixir/caraxes

All issues in TiElixir/caraxes

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.