--- CMakeLists.txt.orig	2023-07-19 08:50:39 UTC
+++ CMakeLists.txt
@@ -299,9 +299,13 @@ if (CLAD_INCLUDE_DOCS)
 endif()
 
 if (NOT CLAD_BUILD_STATIC_ONLY)
-  add_subdirectory(test)
-  add_subdirectory(demos/ErrorEstimation/CustomModel)
-  add_subdirectory(demos/ErrorEstimation/PrintModel)
+  if (FREEBSD_BUILD_TESTS)
+    add_subdirectory(test)
+  endif()
+  if (FREEBSD_BUILD_DEMOS)
+    add_subdirectory(demos/ErrorEstimation/CustomModel)
+    add_subdirectory(demos/ErrorEstimation/PrintModel)
+  endif()
 
   # Add benchmarking infrastructure.
   if (CLAD_ENABLE_BENCHMARKS)
