summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/cmake/package.py21
-rw-r--r--var/spack/repos/builtin/packages/llvm-doe/package.py4
-rw-r--r--var/spack/repos/builtin/packages/llvm/package.py4
3 files changed, 15 insertions, 14 deletions
diff --git a/var/spack/repos/builtin/packages/cmake/package.py b/var/spack/repos/builtin/packages/cmake/package.py
index f7d5636cde..7daade48e7 100644
--- a/var/spack/repos/builtin/packages/cmake/package.py
+++ b/var/spack/repos/builtin/packages/cmake/package.py
@@ -4,10 +4,12 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
+import pathlib
import re
import sys
import spack.build_environment
+from spack.build_systems.cmake import get_cmake_prefix_path
from spack.package import *
@@ -332,6 +334,13 @@ class Cmake(Package):
else:
args.append("-DCMAKE_INSTALL_PREFIX=%s" % self.prefix)
+ # Make CMake find its own dependencies.
+ prefixes = get_cmake_prefix_path(self)
+ rpaths = [
+ pathlib.Path(self.prefix, "lib").as_posix(),
+ pathlib.Path(self.prefix, "lib64").as_posix(),
+ ]
+
args.extend(
[
f"-DCMAKE_BUILD_TYPE={self.spec.variants['build_type'].value}",
@@ -340,17 +349,9 @@ class Cmake(Package):
"-DCMake_TEST_INSTALL=OFF",
f"-DBUILD_CursesDialog={'ON' if '+ncurses' in spec else 'OFF'}",
f"-DBUILD_QtDialog={'ON' if spec.satisfies('+qtgui') else 'OFF'}",
- ]
- )
-
- # Make CMake find its own dependencies.
- rpaths = spack.build_environment.get_rpaths(self)
- prefixes = spack.build_environment.get_cmake_prefix_path(self)
- args.extend(
- [
"-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON",
- "-DCMAKE_INSTALL_RPATH={0}".format(";".join(str(v) for v in rpaths)),
- "-DCMAKE_PREFIX_PATH={0}".format(";".join(str(v) for v in prefixes)),
+ f"-DCMAKE_INSTALL_RPATH={';'.join(rpaths)}",
+ f"-DCMAKE_PREFIX_PATH={';'.join(str(v) for v in prefixes)}",
]
)
diff --git a/var/spack/repos/builtin/packages/llvm-doe/package.py b/var/spack/repos/builtin/packages/llvm-doe/package.py
index 6effe2c057..6bf4f67e50 100644
--- a/var/spack/repos/builtin/packages/llvm-doe/package.py
+++ b/var/spack/repos/builtin/packages/llvm-doe/package.py
@@ -9,8 +9,8 @@ import sys
import llnl.util.tty as tty
-import spack.build_environment
import spack.util.executable
+from spack.build_systems.cmake import get_cmake_prefix_path
from spack.package import *
@@ -573,7 +573,7 @@ class LlvmDoe(CMakePackage, CudaPackage):
# unnecessary if we build openmp via LLVM_ENABLE_RUNTIMES
if self.spec.satisfies("+cuda ~omp_as_runtime"):
ompdir = "build-bootstrapped-omp"
- prefix_paths = spack.build_environment.get_cmake_prefix_path(self)
+ prefix_paths = get_cmake_prefix_path(self)
prefix_paths.append(str(spec.prefix))
# rebuild libomptarget to get bytecode runtime library files
with working_dir(ompdir, create=True):
diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py
index 09388cb5ab..8c9ccb1790 100644
--- a/var/spack/repos/builtin/packages/llvm/package.py
+++ b/var/spack/repos/builtin/packages/llvm/package.py
@@ -10,8 +10,8 @@ import sys
import llnl.util.tty as tty
from llnl.util.lang import classproperty
-import spack.build_environment
import spack.util.executable
+from spack.build_systems.cmake import get_cmake_prefix_path
from spack.package import *
from spack.package_base import PackageBase
@@ -1072,7 +1072,7 @@ class Llvm(CMakePackage, CudaPackage, LlvmDetection, CompilerPackage):
# unnecessary if we build openmp via LLVM_ENABLE_RUNTIMES
if self.spec.satisfies("+cuda openmp=project"):
ompdir = "build-bootstrapped-omp"
- prefix_paths = spack.build_environment.get_cmake_prefix_path(self)
+ prefix_paths = get_cmake_prefix_path(self)
prefix_paths.append(str(spec.prefix))
# rebuild libomptarget to get bytecode runtime library files
with working_dir(ompdir, create=True):