From 7b6e527f440cd7e6f8be2b07cee320ee6ca18786 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 29 Apr 2024 06:41:38 +0200 Subject: Adding upstream version 1.0.1. Signed-off-by: Daniel Baumann --- test cases/cmake/11 cmake_module_path/meson.build | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test cases/cmake/11 cmake_module_path/meson.build (limited to 'test cases/cmake/11 cmake_module_path/meson.build') diff --git a/test cases/cmake/11 cmake_module_path/meson.build b/test cases/cmake/11 cmake_module_path/meson.build new file mode 100644 index 0000000..e201936 --- /dev/null +++ b/test cases/cmake/11 cmake_module_path/meson.build @@ -0,0 +1,25 @@ +# 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). + +project('user CMake find_package module using cmake_module_path', ['c', 'cpp'], + meson_version: '>= 0.55.0') + +if not find_program('cmake', required: false).found() + error('MESON_SKIP_TEST cmake binary not available.') +endif + +# NOTE: can't request Python3 via dependency('Python3', method: 'cmake') +# Meson intercepts and wants "method: auto" + +# Try to find a dependency with a custom CMake module + +dependency('SomethingLikePython', required : true, method : 'cmake', cmake_module_path : 'cmake', modules: 'Python::Interpreter') + +dependency('SomethingLikePython', method : 'cmake', cmake_module_path : ['doesNotExist', 'cmake'], modules: 'Python::Interpreter') + +# Test a custom target with Python::Interpreter in COMMAND +cm = import('cmake') +op = cm.subproject_options() +op.add_cmake_defines({'CMAKE_MODULE_PATH': meson.source_root() / 'cmake'}) +sp = cm.subproject('cmMod', options: op) +main = sp.target('main') +test('main', main) -- cgit v1.2.3