Skip to content

Commit

Permalink
Issue: 7009: CMake/Centos7 Unable to find CMake even though it is ins…
Browse files Browse the repository at this point in the history
…talled

On some systems the binary 'cmake' for version 3 is named 'cmake3',
therefor printing its version number prints:
'cmake3 version X.Y.Z' instead of 'cmake version X.Y.Z'
This '3' digit in the middle breaks the regular expression
extracting the version number.

The following fix permit both way to work and the regexp to
match the proper version number.

Signed-off-by: Alexandre Lavigne <alexandre.lavigne@scality.com>
  • Loading branch information
Alexandre Lavigne authored and jpakkane committed Apr 21, 2020
1 parent 57b468c commit bfea806
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mesonbuild/cmake/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def check_cmake(self, cmakebin: 'ExternalProgram') -> T.Optional[str]:
msg += '\n\nOn Unix-like systems this is often caused by scripts that are not executable.'
mlog.warning(msg)
return None
cmvers = re.sub(r'\s*cmake version\s*', '', out.split('\n')[0]).strip()
cmvers = re.sub(r'\s*(cmake|cmake3) version\s*', '', out.split('\n')[0]).strip()
return cmvers

def set_exec_mode(self, print_cmout: T.Optional[bool] = None, always_capture_stderr: T.Optional[bool] = None) -> None:
Expand Down

0 comments on commit bfea806

Please sign in to comment.