gnuradio / pmt

pmt
GNU Lesser General Public License v3.0
11 stars 11 forks source link

Do proper CMake #14

Closed mormj closed 2 years ago

mormj commented 2 years ago

Since PMT is an external library, it needs all the help it can get to be integrated with other codebases. Meson is good at basic stuff, but seems problematic for exporting CMake Definitions seamlessly

mormj commented 2 years ago

meson so far seems sufficient at building the library itself, but we should have proper cmake for including pmt as a dependency in other projects. - like the cmakeConfig and cmakeTarget stuff.

eli-schwartz commented 2 years ago

Meson is good at basic stuff, but seems problematic for exporting CMake Definitions seamlessly

cmake is a turing-complete ray tracing language, not a build system: https://64.github.io/cmake-raytracer/

Its CMake Definitions are written in that ray tracing language, and do a lot of things they probably should not be doing, which probably cannot be done without intimate knowledge of CMake internals.

Nevertheless, if someone does have that knowledge and wanted to teach meson to export CMake Definitions, that would probably be a fantastic contribution. ;)

but we should have proper cmake for including pmt as a dependency in other projects. - like the cmakeConfig and cmakeTarget stuff

Meson has a built-in pkg-config generator, which is already in use by the pmt project to generate the interoperable standard buildsystem-agnostic dependency export format. It's trivially usable in CMake:

find_package(PkgConfig)
pkg_check_modules(PMT REQUIRED IMPORTED_TARGET GLOBAL pmtf)

pkg-config is even available for Windows, it is just not available by default.

mormj commented 2 years ago

@eli-schwartz - thank you for the vote of confidence here with meson - so far I have not found anything that it is not able to do that I have needed. The only frustration is the lack of custom extensions like CMake has with functions and macros.

I'm hoping to leave everything in meson and not have to bother with CMake at all since it is orders of magnitude easier to read and maintain

But since this library is intended to be integrated with other projects that are heavily invested in CMake (such as GNU radio), just want to make sure that this library can export the right things for seamless integration. Looks like you have provided good guidance on how to do that, so thank you!