| 1 |
# We use Python3 as it's the only thing guaranteed to be available on any platform Meson can run on (unlike Zlib in linuxlike/13 cmake dependency). |
| 2 |
|
| 3 |
project('user CMake find_package module using cmake_module_path', ['c', 'cpp'], |
| 4 |
meson_version: '>= 0.55.0') |
| 5 |
|
| 6 |
# NOTE: can't request Python3 via dependency('Python3', method: 'cmake') |
| 7 |
# Meson intercepts and wants "method: auto" |
| 8 |
|
| 9 |
# Try to find a dependency with a custom CMake module |
| 10 |
|
| 11 |
dependency('SomethingLikePython', required : true, method : 'cmake', cmake_module_path : 'cmake', modules: 'Python::Interpreter') |
| 12 |
|
| 13 |
dependency('SomethingLikePython', method : 'cmake', cmake_module_path : ['doesNotExist', 'cmake'], modules: 'Python::Interpreter') |
| 14 |
|
| 15 |
# Test a custom target with Python::Interpreter in COMMAND |
| 16 |
cm = import('cmake') |
| 17 |
op = cm.subproject_options() |
| 18 |
op.add_cmake_defines({'CMAKE_MODULE_PATH': meson.source_root() / 'cmake'}) |
| 19 |
sp = cm.subproject('cmMod', options: op) |
| 20 |
main = sp.target('main') |
| 21 |
test('main', main) |