aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2019-04-28 15:29:34 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2019-04-28 19:29:56 +0300
commitcb1ef0c44990a710f6c78c5f808bf6e04985f59b (patch)
tree89db5b1affcdf72037cc32c8ef2441ace96f23b5 /mesonbuild/modules
parentcbdf9d06471ed9b682e94f5d9f4084ee35358778 (diff)
downloadmeson-cb1ef0c44990a710f6c78c5f808bf6e04985f59b.zip
meson-cb1ef0c44990a710f6c78c5f808bf6e04985f59b.tar.gz
meson-cb1ef0c44990a710f6c78c5f808bf6e04985f59b.tar.bz2
cmake: Use CMAKE_ROOT instead of _INCLUDE_FILE (closes #5218)
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r--mesonbuild/modules/cmake.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/mesonbuild/modules/cmake.py b/mesonbuild/modules/cmake.py
index 2878134..6af4adb 100644
--- a/mesonbuild/modules/cmake.py
+++ b/mesonbuild/modules/cmake.py
@@ -72,20 +72,12 @@ class CmakeModule(ExtensionModule):
mlog.log('error retrieving cmake informations: returnCode={0} stdout={1} stderr={2}'.format(p.returncode, stdout, stderr))
return False
- match = re.search('\n_INCLUDED_FILE \\"([^"]+)"\n', stdout.strip())
+ match = re.search('\nCMAKE_ROOT \\"([^"]+)"\n', stdout.strip())
if not match:
mlog.log('unable to determine cmake root')
return False
- # compilerpath is something like '/usr/share/cmake-3.5/Modules/Platform/Linux-GNU-CXX.cmake'
- # or 'C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/Platform/Windows-MSVC-CXX.cmake' under windows
- compilerpath = match.group(1)
- pos = compilerpath.find('/Modules/Platform/')
- if pos < 0:
- mlog.log('unknown _INCLUDED_FILE path scheme')
- return False
-
- cmakePath = pathlib.PurePath(compilerpath[0:pos])
+ cmakePath = pathlib.PurePath(match.group(1))
self.cmake_root = os.path.join(*cmakePath.parts)
self.cmake_detected = True
return True