aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/dependencies/base.py11
-rw-r--r--mesonbuild/dependencies/data/CMakePathInfo.txt2
2 files changed, 12 insertions, 1 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index 22f4c6f..0c325cc 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -1095,7 +1095,16 @@ class CMakeDependency(ExternalDependency):
return None
# Extract the variables and sanity check them
- module_paths = sorted(set(temp_parser.get_cmake_var('MESON_PATHS_LIST')))
+ root_paths = set(temp_parser.get_cmake_var('MESON_FIND_ROOT_PATH'))
+ root_paths.update(set(temp_parser.get_cmake_var('MESON_CMAKE_SYSROOT')))
+ root_paths = sorted(root_paths)
+ root_paths = list(filter(lambda x: os.path.isdir(x), root_paths))
+ module_paths = set(temp_parser.get_cmake_var('MESON_PATHS_LIST'))
+ rooted_paths = []
+ for j in [Path(x) for x in root_paths]:
+ for i in [Path(x) for x in module_paths]:
+ rooted_paths.append(str(j / i.relative_to(i.anchor)))
+ module_paths = sorted(module_paths.union(rooted_paths))
module_paths = list(filter(lambda x: os.path.isdir(x), module_paths))
archs = temp_parser.get_cmake_var('MESON_ARCH_LIST')
diff --git a/mesonbuild/dependencies/data/CMakePathInfo.txt b/mesonbuild/dependencies/data/CMakePathInfo.txt
index 713c2da..662ec58 100644
--- a/mesonbuild/dependencies/data/CMakePathInfo.txt
+++ b/mesonbuild/dependencies/data/CMakePathInfo.txt
@@ -25,5 +25,7 @@ endif()
set(MESON_ARCH_LIST ${LIB_ARCH_LIST})
set(MESON_PATHS_LIST ${TMP_PATHS_LIST})
set(MESON_CMAKE_ROOT ${CMAKE_ROOT})
+set(MESON_CMAKE_SYSROOT ${CMAKE_SYSROOT})
+set(MESON_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH})
message(STATUS ${TMP_PATHS_LIST})