diff --git a/cmake/modules/DuneDoc.cmake b/cmake/modules/DuneDoc.cmake
index e69306c8e121f849340ee17f7d9570a80341b720..6bb6a47081fb6e8f41b085c45c3c2902c94d51bb 100644
--- a/cmake/modules/DuneDoc.cmake
+++ b/cmake/modules/DuneDoc.cmake
@@ -1,3 +1,29 @@
+FIND_PACKAGE(LATEX)
+FIND_PROGRAM(IMAGEMAGICK_CONVERT convert
+  DOC "The convert program that comes with ImageMagick (available at http://www.imagemagick.org)."
+  )
+set(LATEX_USABLE ON)
+if(NOT ${LATEX_COMPILER})
+  message(WARING " Need latex to create documentation!")
+  set(LATEX_USABLE)
+endif(NOT ${LATEX_COMPILER})
+if(NOT ${BIBTEX_COMPILER})
+  message(WARING " Need bibtex to create documentation!")
+  set(LATEX_USABLE)
+endif(NOT ${BIBTEX_COMPILER})
+if(NOT ${MAKEINDEX_COMPILER})
+  message(WARING " Need makeindex to create documentation!")
+  set(LATEX_USABLE)
+endif(NOT ${MAKEINDEX_COMPILER})
+if(NOT ${IMAGEMAGICK_CONVERT})
+  message(WARNING " Need imagemagick to create latex documentation!")
+  set(LATEX_USABLE)
+endif(NOT ${IMAGEMAGICK_CONVERT})
+if(LATEX_USABLE)
+  include(UseLATEX)
+endif(LATEX_USABLE)
+
+
 # Module that provides a custom target make doc at the top level
 # directory and utility macros for creating install directives
 # that make sure that the files to be installed are previously
diff --git a/doc/buildsystem/CMakeLists.txt b/doc/buildsystem/CMakeLists.txt
index f398014fd3f35dba46d0140394a98b2c41ca76e0..9baff50d44f9dcee4e281a6a7e8906582cc16203 100644
--- a/doc/buildsystem/CMakeLists.txt
+++ b/doc/buildsystem/CMakeLists.txt
@@ -1,6 +1,7 @@
-include(UseLATEX)
-ADD_LATEX_DOCUMENT(buildsystem.tex FATHER_TARGET doc DEFAULT_PDF INPUTS ../Makefile.am ../../configure.ac ../example.opts)
-create_doc_install(${CMAKE_CURRENT_BINARY_DIR}/buildsystem.pdf share/doc/dune-common/buildsystem)
+if(LATEX_USABLE)
+  ADD_LATEX_DOCUMENT(buildsystem.tex FATHER_TARGET doc DEFAULT_PDF INPUTS ../Makefile.am ../../configure.ac ../example.opts)
+  create_doc_install(${CMAKE_CURRENT_BINARY_DIR}/buildsystem.pdf share/doc/dune-common/buildsystem)
+endif(LATEX_USABLE)
 #add_custom_target(install_buildsystem)
 #install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" --build \"${CMAKE_BINARY_DIR}\" --target buildsystem_install )")
 #install(FILES ${CMAKE_CURRENT_BINARY_DIR}/buildsystem.pdf