aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/Dependencies.md
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2018-11-22 21:30:12 +0100
committerJussi Pakkanen <jpakkane@gmail.com>2018-11-22 22:30:12 +0200
commita0175ecb1412ed1c824e5eaf1629be9ed95f0b78 (patch)
treed3ac1d8f77b921d1517ca4b7290b8ed37ea7ea08 /docs/markdown/Dependencies.md
parent8b88fb990e165a501c3b5798139c21647218c978 (diff)
downloadmeson-a0175ecb1412ed1c824e5eaf1629be9ed95f0b78.zip
meson-a0175ecb1412ed1c824e5eaf1629be9ed95f0b78.tar.gz
meson-a0175ecb1412ed1c824e5eaf1629be9ed95f0b78.tar.bz2
CMake find_package dependency backend (#4444)
Diffstat (limited to 'docs/markdown/Dependencies.md')
-rw-r--r--docs/markdown/Dependencies.md31
1 files changed, 29 insertions, 2 deletions
diff --git a/docs/markdown/Dependencies.md b/docs/markdown/Dependencies.md
index c853677..e3fedc4 100644
--- a/docs/markdown/Dependencies.md
+++ b/docs/markdown/Dependencies.md
@@ -114,13 +114,40 @@ of all the work behind the scenes to make this work.
You can use the keyword `method` to let meson know what method to use
when searching for the dependency. The default value is `auto`.
-Aditional dependencies methods are `pkg-config`, `config-tool`,
+Aditional dependencies methods are `pkg-config`, `config-tool`, `cmake`,
`system`, `sysconfig`, `qmake`, `extraframework` and `dub`.
```meson
cups_dep = dependency('cups', method : 'pkg-config')
```
+The dependency method order for `auto` is:
+
+ 1. `pkg-config`
+ 2. `cmake`
+ 3. `extraframework` (OSX only)
+
+## CMake
+
+Meson can use the CMake `find_package()` function to detect
+dependencies with the builtin `Find<NAME>.cmake` modules and exported
+project configurations (usually in `/usr/lib/cmake`). Meson is able
+to use both the old-style `<NAME>_LIBRARIES` variables as well as
+imported targets.
+
+It is possible to manually specify a list of CMake targets that should
+be used with the `modules` property. Howerver, this step is optional
+since meson tries to automatically guess the correct target based on the
+name of the dependency.
+
+Depending on the dependency it may be neccessary to explicitly specify
+a CMake target with the `modules` property if meson is unable to guess
+it automatically.
+
+```meson
+ cmake_dep = dependency('ZLIB', method : 'cmake', modules : ['ZLIB::ZLIB'])
+```
+
### Some notes on Dub
Please understand that meson is only able to find dependencies that
@@ -218,7 +245,7 @@ libraries that have been compiled for single-threaded use instead.
## CUPS
-`method` may be `auto`, `config-tool`, `pkg-config` or `extraframework`.
+`method` may be `auto`, `config-tool`, `pkg-config`, `cmake` or `extraframework`.
## GL