summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/build_systems/cmake.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/spack/spack/build_systems/cmake.py b/lib/spack/spack/build_systems/cmake.py
index 4435a995fc..240c8a8b18 100644
--- a/lib/spack/spack/build_systems/cmake.py
+++ b/lib/spack/spack/build_systems/cmake.py
@@ -24,6 +24,7 @@
##############################################################################
import inspect
+import os
import platform
import spack.build_environment
@@ -84,9 +85,12 @@ class CMakePackage(PackageBase):
@property
def root_cmakelists_dir(self):
- """Returns the location of the root CMakeLists.txt
+ """The relative path to the directory containing CMakeLists.txt
- :return: directory containing the root CMakeLists.txt
+ This path is relative to the root of the extracted tarball,
+ not to the ``build_directory``. Defaults to the current directory.
+
+ :return: directory containing CMakeLists.txt
"""
return self.stage.source_path
@@ -143,8 +147,9 @@ class CMakePackage(PackageBase):
def cmake(self, spec, prefix):
"""Runs ``cmake`` in the build directory"""
- options = [self.root_cmakelists_dir] + self.std_cmake_args + \
- self.cmake_args()
+ options = [os.path.abspath(self.root_cmakelists_dir)]
+ options += self.std_cmake_args
+ options += self.cmake_args()
with working_dir(self.build_directory, create=True):
inspect.getmodule(self).cmake(*options)