From e3654e14c58d320379e15b6b39f9b8b1ab766148 Mon Sep 17 00:00:00 2001 From: UK992 Date: Tue, 11 Apr 2017 23:29:06 +0200 Subject: Update cmake to 3.7.2 --- python/servo/bootstrap.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'python/servo/bootstrap.py') diff --git a/python/servo/bootstrap.py b/python/servo/bootstrap.py index 72867fcf155..35be5c67b92 100644 --- a/python/servo/bootstrap.py +++ b/python/servo/bootstrap.py @@ -5,6 +5,7 @@ from __future__ import absolute_import, print_function from distutils.spawn import find_executable +from distutils.version import StrictVersion import json import os import platform @@ -204,10 +205,19 @@ def windows_msvc(context, force=False): def package_dir(package): return os.path.join(deps_dir, package, version(package)) + def check_cmake(version): + cmake_path = find_executable("cmake") + if cmake_path: + cmake = subprocess.Popen([cmake_path, "--version"], stdout=PIPE) + cmake_version = cmake.stdout.read().splitlines()[0].replace("cmake version ", "") + if StrictVersion(cmake_version) >= StrictVersion(version): + return True + return False + to_install = {} for package in packages.WINDOWS_MSVC: # Don't install CMake if it already exists in PATH - if package == "cmake" and find_executable(package): + if package == "cmake" and check_cmake(version("cmake")): continue if not os.path.isdir(package_dir(package)): -- cgit v1.2.3