Skip to content

Introduce ECMCargo module

Jan Blackquill requested to merge work/janb/rust-ecm into master

The ECMCargo module offers a way to integrate Cargo-using projects into CMake using projects.

Usage looks like this:

ecm_add_cargo_workspace(
  DIRECTORY src/rs/
  NAME ikona
  FEATURES with-svgcleaner
  VENDOR_TARBALL ikona.cargo.vendor.tar.xz
  VENDOR_CONFIG cargo-vendor-config.toml
)
...
target_link_libraries(ikona
  PRIVATE Qt5::Core Qt5::Widgets Qt5::Quick Qt5::Concurrent KF5::I18n KF5::Kirigami2 KF5::ConfigWidgets "${ikona_artifacts_dir}/libikonars.so")

ECMCargo makes very little assumptions about what exactly a Cargo project consists of, exporting only the output directory by default, with the ability to specify the name of a shared or static library that Cargo will produce in order to create a target.

Additionally, it has facilities for vendoring, making sure not to make the distro experience more painful unlike similar CMake utilities that don't account for the distro experience and end up being painful if not impossible to package under their guidelines.

Merge request reports