From 8e75575b8874e0599db35ab5f67e8bbcde004ae7 Mon Sep 17 00:00:00 2001 From: Elizabeth Fischer Date: Wed, 5 Oct 2016 13:37:20 -0400 Subject: 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. --- lib/spack/spack/build_environment.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3-70-g09d2