mesonbuild / meson

The Meson Build System
http://mesonbuild.com
Apache License 2.0
5.59k stars 1.63k forks source link

Documentation on how to install dependencies #1137

Open santagada opened 7 years ago

santagada commented 7 years ago

Mesos docs says that if you depend on dependencies they will be resolved automatically, but I tried copying the example on https://github.com/mesonbuild/meson/tree/master/test%20cases/frameworks/3%20gmock and running mesos it only says dependency not found:

Dependency GTest found: NO

Meson encountered an error in file meson.build, line 6, column 0:
Dependency "gtest" not found

Is there any docs on how to make this work?

jpakkane commented 7 years ago

That means that the dependency is not available on your system. You need to add it with your distro package manager.

santagada commented 7 years ago

On macOS homebrew specifically doesn't come with it because you should directly download it yourself. I thought menson had support for macos. Conan and others download the soyrce during configuration.

QuLogic commented 7 years ago

Conan is a package manager; meson is a build tool.

nirbheek commented 7 years ago

Meson is a build system, like Autotools, CMake, Waf, etc. It does not handle automatic downloading of system dependencies. For that, you will need something like Macports, Homebrew, etc. I'm not sure what you're expecting Meson to do here.

santagada commented 7 years ago

Yeah I got it confused. I came from more modern languages that don't have a differing concept between downloading dependencies and build system. CMake does have support for downloading dependencies by using external packages (and is was biicode, hunter and other extensions for it use) but is Meson doesn't have it its fine.

Maybe docs should be clear about it specially when for what I've seen in the source the "automatic" resolution for gtest is just looking for it on linux specific paths (on macOS if a package manager would install gtest it would have to put it on /usr/local/src not on /usr/src).

In sum there is no ExternalProject (https://cmake.org/cmake/help/v3.0/module/ExternalProject.html) like in CMake?

jpakkane commented 7 years ago

If your system does not ship with gtest, then you can use the wrap dependency system and download it automatically from wrapdb.

Note however that because gtest is "special" you still need to write some code to compile it with your project specific settings. We should probably write some docs on how to do that.

santagada commented 7 years ago

well as I got the impression that meson didn't download sources for compilation I just learned enough CMake import the code for now. But please do write the docs for it meson does seems much less complicated than CMake and I would like to switch in the future.