CMakePackage: allow custom CMAKE_PREFIX_PATH entries (#32547)

* define `cmake_prefix_paths` property for packages

add to CMake arguments via CMakePackage

Co-authored-by: Robert Underwood <runderwood@anl.gov>
This commit is contained in:
Peter Scheibel
2022-09-08 16:23:04 -07:00
committed by GitHub
parent e3f87035b6
commit 02151ac649
6 changed files with 62 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class DefineCmakePrefixPaths(Package):
"""Package that defines cmake_prefix_paths"""
homepage = "http://www.example.com"
url = "http://www.example.com/definecmakeprefixpaths-1.0.tar.gz"
version("1.0", "0123456789abcdef0123456789abcdef")
@property
def cmake_prefix_paths(self):
paths = [self.prefix.test]
return paths

View File

@@ -0,0 +1,17 @@
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class DependsOnDefineCmakePrefixPaths(Package):
"""Package that defines cmake_prefix_paths"""
homepage = "http://www.example.com"
url = "http://www.example.com/dependsonefinecmakeprefixpaths-1.0.tar.gz"
version("1.0", "0123456789abcdef0123456789abcdef")
depends_on("define-cmake-prefix-paths")