diff --git a/CMakeLists.txt b/CMakeLists.txt
index d7c7318458823c05c9f385c1b5c50118534f6a76..93eb3fa005eda92b4884d61cfa8963fc237b5354 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -706,6 +706,12 @@ else()
   message(" gnuplot: not found!")
 endif()
 
+if (GMSH)
+  message(" gmsh: ${GMSH}")
+else()
+  message(" gmsh: not found!")
+endif()
+
 if (PYGMENTIZE)
   message(" pygmentize: ${PYGMENTIZE}")
 else()
@@ -718,7 +724,7 @@ else()
   message(" pdflatex: not found!")
 endif()
 
-if (NOT EMACS OR NOT GNUPLOT_FOUND)
+if (NOT EMACS OR NOT GNUPLOT_FOUND OR NOT GMSH)
   message(" ** Cannot build documentation: missing ")
 elseif(NOT LATEX_PDFLATEX_FOUND OR NOT PYGMENTIZE)
   message(" ** Cannot build pdf documentation: missing")
@@ -729,6 +735,9 @@ endif()
 if (NOT GNUPLOT_FOUND)
   message("    - gnuplot")
 endif()
+if (NOT GMSH)
+  message("    - gmsh")
+endif()
 if (NOT LATEX_PDFLATEX_FOUND)
   message("    - pdflatex")
 endif()
diff --git a/README.md b/README.md
index 62d6b43773cb0164a29e8a3716a818c5ec219c7d..36e460a851a53d40b4ab442460594091fa22b20f 100644
--- a/README.md
+++ b/README.md
@@ -86,7 +86,7 @@ apt install slepc-dev
 
 ### User documentation
 
-To build documentation one requires `emacs` and `gnuplot`,
+To build documentation one requires `emacs`, `gmsh` and `gnuplot`,
 additionally since examples results are generated, the documentation
 can only be produced after the compilation of `pugs` itself.
 
@@ -94,6 +94,10 @@ To install `emacs` on Debian-like systems
 ```shell
 apt install emacs
 ```
+To install `gmsh` on Debian-like systems
+```shell
+apt install gmsh
+```
 To install `gnuplot` one can either use
 ```shell
 apt install gnuplot-nox
@@ -106,6 +110,7 @@ apt install gnuplot-x11
 > When building the documentation for the first time, a local `emacs`
 > configuration is generated. *This requires an internet connection.*
 
+
 These packages are enough to build the html documentation. To build
 the pdf documentation one requires a few more packages: `pdflatex`
 (actually a fresh texlive installation is probably necessary) and `pygmentize`
diff --git a/cmake/PugsDoc.cmake b/cmake/PugsDoc.cmake
index 1f8701ccc20f6416b529908f3893d971e86c7452..b067a5cc828ec0c245e8d51c0bda46a96dcce702 100644
--- a/cmake/PugsDoc.cmake
+++ b/cmake/PugsDoc.cmake
@@ -12,10 +12,13 @@ find_program(PYGMENTIZE pygmentize)
 # check for gnuplot
 find_package(Gnuplot)
 
+# check for gmsh
+find_program(GMSH NAMES gmsh)
+
 add_custom_target(userdoc)
 add_custom_target(doc DEPENDS userdoc)
 
-if (EMACS AND GNUPLOT_FOUND)
+if (EMACS AND GNUPLOT_FOUND AND GMSH)
 
   add_custom_command(
     OUTPUT "${PUGS_BINARY_DIR}/doc"
@@ -129,6 +132,13 @@ else()
       COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --red --bold "gnuplot missing")
     add_dependencies(userdoc userdoc-missing-gnuplot)
   endif()
+
+  if (NOT GMSH)
+    add_custom_target(userdoc-missing-gmsh
+      COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --no-newline "Cannot build documentation: "
+      COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --red --bold "gmsh missing")
+    add_dependencies(userdoc userdoc-missing-gmsh)
+  endif()
 endif()
 
 add_dependencies(doc userdoc)