diff options
Diffstat (limited to 'var/spack/repos/builtin/packages/cmake/package.py')
-rw-r--r-- | var/spack/repos/builtin/packages/cmake/package.py | 57 |
1 files changed, 46 insertions, 11 deletions
diff --git a/var/spack/repos/builtin/packages/cmake/package.py b/var/spack/repos/builtin/packages/cmake/package.py index f67ae21ebd..cc93c7067c 100644 --- a/var/spack/repos/builtin/packages/cmake/package.py +++ b/var/spack/repos/builtin/packages/cmake/package.py @@ -28,23 +28,58 @@ class Cmake(Package): """A cross-platform, open-source build system. CMake is a family of tools designed to build, test and package software.""" homepage = 'https://www.cmake.org' + url = 'https://cmake.org/files/v3.4/cmake-3.4.3.tar.gz' - version('2.8.10.2', '097278785da7182ec0aea8769d06860c', - url = 'http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz') - - version('3.0.2', 'db4c687a31444a929d2fdc36c4dfb95f', - url = 'http://www.cmake.org/files/v3.0/cmake-3.0.2.tar.gz') - - version('3.4.0', 'cd3034e0a44256a0917e254167217fc8', - url = 'http://cmake.org/files/v3.4/cmake-3.4.0.tar.gz') + version('3.5.0', '33c5d09d4c33d4ffcc63578a6ba8777e') + version('3.4.3', '4cb3ff35b2472aae70f542116d616e63') + version('3.4.0', 'cd3034e0a44256a0917e254167217fc8') + version('3.3.1', '52638576f4e1e621fed6c3410d3a1b12') + version('3.0.2', 'db4c687a31444a929d2fdc36c4dfb95f') + version('2.8.10.2', '097278785da7182ec0aea8769d06860c') variant('ncurses', default=True, description='Enables the build of the ncurses gui') + variant('qt', default=False, description='Enables the build of cmake-gui') + variant('doc', default=False, description='Enables the generation of html and man page documentation') depends_on('ncurses', when='+ncurses') + depends_on('qt', when='+qt') + depends_on('python@2.7.11:', when='+doc') + depends_on('py-sphinx', when='+doc') + + def url_for_version(self, version): + """Handle CMake's version-based custom URLs.""" + return 'https://cmake.org/files/v%s/cmake-%s.tar.gz' % (version.up_to(2), version) + + def validate(self, spec): + """ + Checks if incompatible versions of qt were specified + + :param spec: spec of the package + :raises RuntimeError: in case of inconsistencies + """ + + if '+qt' in spec and spec.satisfies('^qt@5.4.0'): + msg = 'qt-5.4.0 has broken CMake modules.' + raise RuntimeError(msg) def install(self, spec, prefix): - configure('--prefix=' + prefix, - '--parallel=' + str(make_jobs), - '--', '-DCMAKE_USE_OPENSSL=ON') + # Consistency check + self.validate(spec) + + # configure, build, install: + options = ['--prefix=%s' % prefix] + options.append('--parallel=%s' % str(make_jobs)) + + if '+qt' in spec: + options.append('--qt-gui') + + if '+doc' in spec: + options.append('--sphinx-html') + options.append('--sphinx-man') + + options.append('--') + options.append('-DCMAKE_USE_OPENSSL=ON') + + configure(*options) make() make('install') |