henson: simplify args logic with define_from_variant (#36398)
Co-authored-by: Arnur Nigmetov <nigmetov@tugraz.at>
This commit is contained in:
parent
693eea499c
commit
e4edcf6104
@ -26,15 +26,12 @@ class Henson(CMakePackage):
|
|||||||
conflicts("^openmpi", when="+mpi-wrappers")
|
conflicts("^openmpi", when="+mpi-wrappers")
|
||||||
|
|
||||||
def cmake_args(self):
|
def cmake_args(self):
|
||||||
args = []
|
args = [
|
||||||
if "+python" in self.spec:
|
self.define_from_variant("python", "python"),
|
||||||
args += ["-Dpython=on"]
|
self.define_from_variant("mpi-wrappers", "mpi-wrappers"),
|
||||||
else:
|
]
|
||||||
args += ["-Dpython=off"]
|
|
||||||
|
|
||||||
if "+mpi-wrappers" in self.spec:
|
if self.spec.satisfies("+python"):
|
||||||
args += ["-Dmpi-wrappers=on"]
|
args += [self.define("PYTHON_EXECUTABLE", self.spec["python"].command.path)]
|
||||||
else:
|
|
||||||
args += ["-Dmpi-wrappers=off"]
|
|
||||||
|
|
||||||
return args
|
return args
|
||||||
|
Loading…
Reference in New Issue
Block a user