summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorElizabeth Fischer <rpf2116@columbia.edu>2016-10-05 13:37:20 -0400
committerTodd Gamblin <tgamblin@llnl.gov>2016-10-05 10:37:20 -0700
commit8e75575b8874e0599db35ab5f67e8bbcde004ae7 (patch)
treeca6625ed3af41d06ab3d7df3735aad20e10a9b47 /lib
parent42c69b3809c09a3d86e85c237180872ad95d9036 (diff)
downloadspack-8e75575b8874e0599db35ab5f67e8bbcde004ae7.tar.gz
spack-8e75575b8874e0599db35ab5f67e8bbcde004ae7.tar.bz2
spack-8e75575b8874e0599db35ab5f67e8bbcde004ae7.tar.xz
spack-8e75575b8874e0599db35ab5f67e8bbcde004ae7.zip
Added missing function for CMake builds. (#1250)
* Added missing function for CMake builds. * Update build_environment.py * std_cmake_args Changed std_cmake_args to use get_std_cmake_args(). * Update build_environment.py Delete additional lines subsumed by get_std_cmake_args() * flake8.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/build_environment.py24
1 files changed, 15 insertions, 9 deletions
diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py
index c3fa7418e8..cc5cfc6b39 100644
--- a/lib/spack/spack/build_environment.py
+++ b/lib/spack/spack/build_environment.py
@@ -350,15 +350,7 @@ def set_module_variables_for_package(pkg, module):
m.ctest = Executable('ctest')
# standard CMake arguments
- m.std_cmake_args = ['-DCMAKE_INSTALL_PREFIX=%s' % pkg.prefix,
- '-DCMAKE_BUILD_TYPE=RelWithDebInfo']
- if platform.mac_ver()[0]:
- m.std_cmake_args.append('-DCMAKE_FIND_FRAMEWORK=LAST')
-
- # Set up CMake rpath
- m.std_cmake_args.append('-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE')
- m.std_cmake_args.append('-DCMAKE_INSTALL_RPATH=%s' %
- ":".join(get_rpaths(pkg)))
+ m.std_cmake_args = get_std_cmake_args(pkg)
# Put spack compiler paths in module scope.
link_dir = spack.build_env_path
@@ -410,6 +402,20 @@ def get_rpaths(pkg):
return rpaths
+def get_std_cmake_args(cmake_pkg):
+ # standard CMake arguments
+ ret = ['-DCMAKE_INSTALL_PREFIX=%s' % cmake_pkg.prefix,
+ '-DCMAKE_BUILD_TYPE=RelWithDebInfo']
+ if platform.mac_ver()[0]:
+ ret.append('-DCMAKE_FIND_FRAMEWORK=LAST')
+
+ # Set up CMake rpath
+ ret.append('-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE')
+ ret.append('-DCMAKE_INSTALL_RPATH=%s' % ":".join(get_rpaths(cmake_pkg)))
+
+ return ret
+
+
def parent_class_modules(cls):
"""
Get list of super class modules that are all descend from spack.Package