From ba566225741081bc26c7cf6c6c652ac0de6e6471 Mon Sep 17 00:00:00 2001 From: Stephen Nicholas Swatman Date: Thu, 22 Aug 2024 13:13:21 +0200 Subject: [PATCH] geomodel: fix bug in cmake_args (#45869) --- .../repos/builtin/packages/geomodel/package.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/var/spack/repos/builtin/packages/geomodel/package.py b/var/spack/repos/builtin/packages/geomodel/package.py index 2fc531fbf870ed..43f81110c54477 100644 --- a/var/spack/repos/builtin/packages/geomodel/package.py +++ b/var/spack/repos/builtin/packages/geomodel/package.py @@ -71,16 +71,12 @@ class Geomodel(CMakePackage): depends_on("opengl") def cmake_args(self): - def cmake_variant(cmake_label, spack_variant): - enabled = spec.satisfies("+" + spack_variant) - return f"-DGEOMODEL_BUILD_{cmake_label}={enabled}" - args = [ - cmake_variant("VISUALIZATION", "visualization"), - cmake_variant("GEOMODELG4", "geomodelg4"), - cmake_variant("FULLSIMLIGHT", "fullsimlight"), - cmake_variant("FSL", "fsl"), - cmake_variant("EXAMPLES", "examples"), - cmake_variant("TOOLS", "tools"), + self.define_from_variant("GEOMODEL_BUILD_VISUALIZATION", "visualization"), + self.define_from_variant("GEOMODEL_BUILD_GEOMODELG4", "geomodelg4"), + self.define_from_variant("GEOMODEL_BUILD_FULLSIMLIGHT", "fullsimlight"), + self.define_from_variant("GEOMODEL_BUILD_FSL", "fsl"), + self.define_from_variant("GEOMODEL_BUILD_EXAMPLES", "examples"), + self.define_from_variant("GEOMODEL_BUILD_TOOLS", "tools"), ] return args