Is there a tool for meson similar/equivalent to CPack for CMake?
Asked Answered
E

1

7

I have recently started learning meson and I am testing switching to it (from CMake) in one of my projects. The problem is that I usually use cpack to build the project's packages/installers, and after scouring the meson docs for something similar to cpack I am unable to find anything.

Requirements/what I currently use cpack for

  • Single script to automatically build and package binary releases (such as deb, rpm, windows installer, etc)
  • Integrates with the build system - Picks up targets automatically, doesn't require redefining installation logic or structure
  • Supports building at least deb packages and a windows installer (don't care which)

There is the information on building release archives and then using scripts to process them with packaging tools (such as inno). However, this is not really what I am looking for as it is far more awkward and inflexible than cpack (i.e I have to change 3 different scripts if the directory structure changes).

Ultimately I can learn to use the meson system and manually write packaging scripts, no doubt it will make me a better scripter, however, I am eager to know if there is a better way of doing this which is not advertised in the docs or if there is some unofficial project which will automate the process.

Edit

By package I mean like a deb package - a package for a system package manager, not something like conan

Eisegesis answered 2/2, 2020 at 15:11 Comment(0)
D
5

I suggest that you use conan. Please take a look at conan configuration in the Meson.

Droshky answered 2/2, 2020 at 15:23 Comment(6)
Thanks I shall take a lookEisegesis
@TheGoldKnight23 Could you voted up if this answer is useful?Droshky
I have but my rep is below 15 :)Eisegesis
Alright so looking into Conan it looks very useful and will certainly be using it, however I am looking for something which can generate packages (i.e deb, rpm, etc), this doesn't seem to be dooable with conan?Eisegesis
@TheGoldKnight23 Perhaps, you are searching a Yocto Project but The Yocto Project is used to create own distribution, so I think is probably overengineering for you. In conan you can create packages, so please take a look at conan docs.Droshky
I have looked at the Conan docs and am investigating using for an internal dependency management actually, but in terms of creating packages like .deb and .rpm, it doesn't seem to be designed for it. I am currently looking at using it to archive the project and then run dh-make, debuild, etc. But this is a much more complex process than CPack and requires a deal of custom scripting. I am aware I have probably run into the "packaging is a pain in the arse" wall but I was hoping there was something else out they're which was maybe build system agnostic (like Conan but for systems)Eisegesis

© 2022 - 2024 — McMap. All rights reserved.