parent
0d19d334a8
commit
0714ba58c7
7 changed files with 70 additions and 4 deletions
@ -0,0 +1,16 @@ |
||||
## CMake prefix path overrides |
||||
|
||||
When using pkg-config as a dependency resolver we can pass |
||||
`-Dpkg_config_path=$somepath` to extend or overwrite where pkg-config will |
||||
search for dependencies. Now cmake can do the same, as long as the dependency |
||||
uses a ${Name}Config.cmake file (not a Find{$Name}.cmake file), by passing |
||||
`-Dcmake_prefix_path=list,of,paths`. It is important that point this at the |
||||
prefix that the dependency is installed into, not the cmake path. |
||||
|
||||
If you have installed something to `/tmp/dep`, which has a layout like: |
||||
``` |
||||
/tmp/dep/lib/cmake |
||||
/tmp/dep/bin |
||||
``` |
||||
|
||||
then invoke meson as `meson builddir/ -Dcmake_prefix_path=/tmp/dep` |
@ -0,0 +1,4 @@ |
||||
project('cmake prefix path test') |
||||
|
||||
d = dependency('mesontest', method : 'cmake') |
||||
assert(d.version() == '1.2.3', 'Got the wrong version!') |
@ -0,0 +1,4 @@ |
||||
set(MESONTEST_VERSION "1.2.3") |
||||
set(MESONTEST_LIBRARIES "foo.so") |
||||
set(MESONTEST_INCLUDE_DIR "") |
||||
set(MESONTEST_FOUND "TRUE") |
Loading…
Reference in new issue