add flag to turn off building tests and examples (#44075)

This commit is contained in:
Jake Koester 2024-05-08 12:33:49 -06:00 committed by GitHub
parent ddf94291d4
commit 9ab6c30a3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -31,6 +31,8 @@ class Compadre(CMakePackage):
variant("mpi", default=False, description="Enable MPI support")
depends_on("mpi", when="+mpi")
variant("tests", default=True, description="Enable tests and examples")
# fixes duplicate symbol issue with static library build
patch(
"https://patch-diff.githubusercontent.com/raw/sandialabs/Compadre/pull/286.patch?full_index=1",
@ -56,6 +58,10 @@ def cmake_args(self):
if "+mpi" in spec:
options.append("-DCompadre_USE_MPI:BOOL=ON")
if "~tests" in spec:
options.append("-DCompadre_EXAMPLES:BOOL=OFF")
options.append("-DCompadre_TESTS:BOOL=OFF")
if "+shared" in spec:
options.append("-DBUILD_SHARED_LIBS:BOOL=ON")
else: