diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2018-11-22 21:30:12 +0100 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-11-22 22:30:12 +0200 |
commit | a0175ecb1412ed1c824e5eaf1629be9ed95f0b78 (patch) | |
tree | d3ac1d8f77b921d1517ca4b7290b8ed37ea7ea08 /docs/markdown/snippets | |
parent | 8b88fb990e165a501c3b5798139c21647218c978 (diff) | |
download | meson-a0175ecb1412ed1c824e5eaf1629be9ed95f0b78.zip meson-a0175ecb1412ed1c824e5eaf1629be9ed95f0b78.tar.gz meson-a0175ecb1412ed1c824e5eaf1629be9ed95f0b78.tar.bz2 |
CMake find_package dependency backend (#4444)
Diffstat (limited to 'docs/markdown/snippets')
-rw-r--r-- | docs/markdown/snippets/cmake.md | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/markdown/snippets/cmake.md b/docs/markdown/snippets/cmake.md new file mode 100644 index 0000000..8848c7b --- /dev/null +++ b/docs/markdown/snippets/cmake.md @@ -0,0 +1,19 @@ +## CMake `find_package` dependency backend + +Meson can now use the CMake `find_package` ecosystem to +detect dependencies. Both the old-style `<NAME>_LIBRARIES` +variables as well as imported targets are supported. Meson +can automatically guess the correct CMake target in most +cases but it is also possible to manually specify a target +with the `modules` property. + +```meson +# Implicitly uses CMake as a fallback and guesses a target +dep1 = dependency('KF5TextEditor') + +# Manually specify one or more CMake targets to use +dep2 = dependency('ZLIB', method : 'cmake', modules : ['ZLIB::ZLIB']) +``` + +CMake is automatically used after `pkg-config` fails when +no `method` (or `auto`) was provided in the dependency options. |