diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 33462df5ef0c61e82c41d87ebdef7812e027fe56..88efd902216084a1a828f91008c1c1cd4fdc7fc3 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -950,7 +950,7 @@ if(BUILD_DOC)
   )
 
   add_custom_target(
-    doc
+    doc ALL
     DEPENDS html
     SOURCES ${LAMMPS_DOC_DIR}/utils/requirements.txt ${DOC_SOURCES}
   )