summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2017-07-18 11:58:19 -0500
committerbecker33 <becker33@llnl.gov>2017-07-18 09:58:19 -0700
commit1215c3b20c28edfb8bcb21ad764b0940fa78e268 (patch)
treec16043d9b50066c4eaf34a7ee08bd810be328eef /lib
parent5a1ee2257534497e7e436fa72f94da6e4e0e03e7 (diff)
downloadspack-1215c3b20c28edfb8bcb21ad764b0940fa78e268.tar.gz
spack-1215c3b20c28edfb8bcb21ad764b0940fa78e268.tar.bz2
spack-1215c3b20c28edfb8bcb21ad764b0940fa78e268.tar.xz
spack-1215c3b20c28edfb8bcb21ad764b0940fa78e268.zip
Change path to CMakeLists.txt to be relative to root, not pwd (#4420)
* Change path to CMakeLists.txt to be relative to root, not pwd * Changes requested during code review * Revert back to old naming of root_cmakelists_dir * Make relative directory more clear in docs * Revert change causing build_type AttributeError * Fix forgotten abs_path var * Update CLHEP with new relative path * Update more packages with new root_cmakelists_dir syntax
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)