hepmc3: pass root variant cxxstd as HEPMC3_CXX_STANDARD (#44806)

* hepmc3: pass `root` variant `cxxstd` as `HEPMC3_CXX_STANDARD`

* hepmc3: when @:3.2.3 +rootio, depends_on root cxxstd=11

* [@spackbot] updating style on behalf of wdconinc

---------

Co-authored-by: wdconinc <wdconinc@users.noreply.github.com>
This commit is contained in:
Wouter Deconinck 2024-06-25 05:50:36 -05:00 committed by GitHub
parent d8b0df6f5b
commit 81125c3bd8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -44,7 +44,9 @@ class Hepmc3(CMakePackage):
)
depends_on("cmake@2.8.9:", type="build")
depends_on("root", when="+rootio")
with when("+rootio"):
depends_on("root")
depends_on("root cxxstd=11", when="@:3.2.3")
depends_on("protobuf", when="+protobuf")
depends_on("python", when="+python")
@ -62,7 +64,7 @@ def cmake_args(self):
self.define("HEPMC3_ENABLE_TEST", self.run_tests),
]
if "+python" in spec:
if spec.satisfies("+python"):
py_ver = spec["python"].version.up_to(2)
args.extend(
[
@ -71,7 +73,11 @@ def cmake_args(self):
]
)
if "+rootio" in spec:
if spec.satisfies("+rootio"):
args.append(self.define("ROOT_DIR", spec["root"].prefix))
if spec.satisfies("@3.2.4:"):
args.append(
self.define("HEPMC3_CXX_STANDARD", spec["root"].variants["cxxstd"].value)
)
return args