--- CMakeLists.txt.orig	2022-09-19 11:42:41 UTC
+++ CMakeLists.txt
@@ -183,9 +183,13 @@ add_subdirectory(fdbbackup)
   add_subdirectory(fdbservice)
 endif()
 add_subdirectory(fdbbackup)
-add_subdirectory(contrib)
+if(WITH_CONTRIB)
+  add_subdirectory(contrib)
+endif()
 add_subdirectory(tests)
-add_subdirectory(flowbench EXCLUDE_FROM_ALL)
+if(WITH_FLOWBENCH)
+  add_subdirectory(flowbench EXCLUDE_FROM_ALL)
+endif()
 if(WITH_PYTHON AND WITH_C_BINDING)
   add_subdirectory(bindings)
 endif()
