spglib: add tests variant and cmake requirement (#42242)

Fixes #42241
This commit is contained in:
Loris Ercole 2024-01-23 19:38:42 +01:00 committed by GitHub
parent 9be7f2328f
commit b3d0f19fe7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -52,6 +52,10 @@ class Spglib(CMakePackage):
variant("openmp", default=True, description="Build with OpenMP support", when="@1.16.2:")
variant("fortran", default=True, description="Build Fortran interface", when="@1.16.4:")
variant("tests", default=False, description="Build with tests", when="@2.1.0:")
depends_on("cmake@3.15:", type="build", when="@2.1.0:")
depends_on("cmake@3.24:", type="build", when="+tests")
@property
def libs(self):
@ -62,4 +66,5 @@ def cmake_args(self):
return [
self.define_from_variant(pfx + "USE_OMP", "openmp"),
self.define_from_variant(pfx + "WITH_Fortran", "fortran"),
self.define_from_variant(pfx + "WITH_TESTS", "tests"),
]