Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 300
Object object Avatar asked Feb 02 '20 15:02

Object object


2 Answers

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

like image 171
Szymon Janora Avatar answered Sep 21 '22 07:09

Szymon Janora


It might be worth considering using meson rpm packaging module RPM module:

It autodetects installed files, dependencies and so on

This module as of now supports only generation of RPM spec file:

rpm = import('rpm')
rpm.generate_spec_template()
like image 28
pmod Avatar answered Sep 18 '22 07:09

pmod