summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/cmake/package.py
diff options
context:
space:
mode:
Diffstat (limited to 'var/spack/repos/builtin/packages/cmake/package.py')
-rw-r--r--var/spack/repos/builtin/packages/cmake/package.py29
1 files changed, 8 insertions, 21 deletions
diff --git a/var/spack/repos/builtin/packages/cmake/package.py b/var/spack/repos/builtin/packages/cmake/package.py
index 2cf30956be..1cb3cf33f6 100644
--- a/var/spack/repos/builtin/packages/cmake/package.py
+++ b/var/spack/repos/builtin/packages/cmake/package.py
@@ -2,21 +2,18 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack import *
-
import re
-import os
class Cmake(Package):
"""A cross-platform, open-source build system. CMake is a family of
- tools designed to build, test and package software."""
+ tools designed to build, test and package software.
+ """
homepage = 'https://www.cmake.org'
- url = 'https://github.com/Kitware/CMake/releases/download/v3.15.5/cmake-3.15.5.tar.gz'
+ url = 'https://github.com/Kitware/CMake/releases/download/v3.15.5/cmake-3.15.5.tar.gz'
maintainers = ['chuckatkins']
- executables = ['cmake']
+ executables = ['^cmake$']
version('3.18.1', sha256='c0e3338bd37e67155b9d1e9526fec326b5c541f74857771b7ffed0c46ad62508')
version('3.18.0', sha256='83b4ffcb9482a73961521d2bafe4a16df0168f03f56e6624c419c461e5317e29')
@@ -163,20 +160,10 @@ class Cmake(Package):
phases = ['bootstrap', 'build', 'install']
@classmethod
- def determine_spec_details(cls, prefix, exes_in_prefix):
- exe_to_path = dict(
- (os.path.basename(p), p) for p in exes_in_prefix
- )
- if 'cmake' not in exe_to_path:
- return None
-
- cmake = spack.util.executable.Executable(exe_to_path['cmake'])
- output = cmake('--version', output=str)
- if output:
- match = re.search(r'cmake.*version\s+(\S+)', output)
- if match:
- version_str = match.group(1)
- return Spec('cmake@{0}'.format(version_str))
+ def determine_version(cls, exe):
+ output = Executable(exe)('--version', output=str)
+ match = re.search(r'cmake.*version\s+(\S+)', output)
+ return match.group(1) if match else None
def flag_handler(self, name, flags):
if name == 'cxxflags' and self.compiler.name == 'fj':