--- CMakeLists.txt.orig	2021-03-01 17:31:02 UTC
+++ CMakeLists.txt
@@ -168,15 +168,19 @@ add_subdirectory(po)
 
 
 # build docs
+if (FREEBSD_INSTALL_DOCS)
 add_subdirectory(docs/libdnf)
 if(WITH_BINDINGS)
     add_subdirectory(docs/hawkey)
 endif()
+endif()
 
 
 # build tests
+if (BUILD_TESTING)
 enable_testing()
 add_subdirectory(tests)
+endif()
 if(WITH_BINDINGS)
     add_subdirectory(python/hawkey)
 endif()
