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.
This commit is contained in:
parent
42c69b3809
commit
8e75575b88
@ -350,15 +350,7 @@ def set_module_variables_for_package(pkg, module):
|
|||||||
m.ctest = Executable('ctest')
|
m.ctest = Executable('ctest')
|
||||||
|
|
||||||
# standard CMake arguments
|
# standard CMake arguments
|
||||||
m.std_cmake_args = ['-DCMAKE_INSTALL_PREFIX=%s' % pkg.prefix,
|
m.std_cmake_args = get_std_cmake_args(pkg)
|
||||||
'-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)))
|
|
||||||
|
|
||||||
# Put spack compiler paths in module scope.
|
# Put spack compiler paths in module scope.
|
||||||
link_dir = spack.build_env_path
|
link_dir = spack.build_env_path
|
||||||
@ -410,6 +402,20 @@ def get_rpaths(pkg):
|
|||||||
return rpaths
|
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):
|
def parent_class_modules(cls):
|
||||||
"""
|
"""
|
||||||
Get list of super class modules that are all descend from spack.Package
|
Get list of super class modules that are all descend from spack.Package
|
||||||
|
Loading…
Reference in New Issue
Block a user