summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn W. Parent <45471568+johnwparent@users.noreply.github.com>2023-06-08 13:05:38 -0400
committerGitHub <noreply@github.com>2023-06-08 10:05:38 -0700
commit06817600e4416aec1d32bf39bb9ee10b948cf33a (patch)
tree77864b3c9b8a7fa163db3e9064faeca045ca3d80
parent4ae1a73d54b33bc4876535422d3f3bf3d9641c51 (diff)
downloadspack-06817600e4416aec1d32bf39bb9ee10b948cf33a.tar.gz
spack-06817600e4416aec1d32bf39bb9ee10b948cf33a.tar.bz2
spack-06817600e4416aec1d32bf39bb9ee10b948cf33a.tar.xz
spack-06817600e4416aec1d32bf39bb9ee10b948cf33a.zip
CMake/Windows bugfix: Make CMAKE_INSTALL_PREFIX a posix path (#36842)
CMake gives off a warning when passed Windows style paths as install prefixes as the resultant path often causes invalid escape sequences.
-rw-r--r--lib/spack/spack/build_systems/cmake.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/spack/spack/build_systems/cmake.py b/lib/spack/spack/build_systems/cmake.py
index f3b4ad35d6..8e819f3958 100644
--- a/lib/spack/spack/build_systems/cmake.py
+++ b/lib/spack/spack/build_systems/cmake.py
@@ -5,6 +5,7 @@
import collections.abc
import inspect
import os
+import pathlib
import platform
import re
import sys
@@ -15,7 +16,6 @@ import llnl.util.filesystem as fs
import spack.build_environment
import spack.builder
import spack.package_base
-import spack.util.path
from spack.directives import build_system, conflicts, depends_on, variant
from spack.multimethod import when
@@ -271,7 +271,7 @@ class CMakeBuilder(BaseBuilder):
args = [
"-G",
generator,
- define("CMAKE_INSTALL_PREFIX", pkg.prefix),
+ define("CMAKE_INSTALL_PREFIX", pathlib.Path(pkg.prefix).as_posix()),
define("CMAKE_BUILD_TYPE", build_type),
define("BUILD_TESTING", pkg.run_tests),
]