--- a/Modules/FindDoxygen.cmake	2010-03-16 21:29:30.000000000 +0100
+++ b/Modules/FindDoxygen.cmake	2010-05-15 15:35:55.000000000 +0200
@@ -11,6 +11,7 @@
 #
 #   DOXYGEN_EXECUTABLE     = The path to the doxygen command.
 #   DOXYGEN_FOUND          = Was Doxygen found or not?
+#   DOXYGEN_VERSION        = The version of Doxygen found in the system (MAJOR.MINOR.PATCH)
 #
 #   DOXYGEN_DOT_EXECUTABLE = The path to the dot program used by doxygen.
 #   DOXYGEN_DOT_FOUND      = Was Dot found or not?
@@ -80,6 +81,33 @@
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Doxygen DEFAULT_MSG DOXYGEN_EXECUTABLE)
 
 #
+# Get doxygen version
+#
+
+if(DOXYGEN_FOUND)
+  EXEC_PROGRAM(${DOXYGEN_EXECUTABLE} ARGS "--version"
+    OUTPUT_VARIABLE DOXYGEN_VERSION)
+  STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" DOXYGEN_VERSION_MAJOR "${DOXYGEN_VERSION}")
+  STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" DOXYGEN_VERSION_MINOR "${DOXYGEN_VERSION}")
+  STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" DOXYGEN_VERSION_PATCH "${DOXYGEN_VERSION}")
+  
+  # If a version is passed to find_package() command, that version is
+  # checked against the installed one
+  if(Doxygen_FIND_VERSION)
+    if(Doxygen_FIND_VERSION_EXACT AND NOT ${DOXYGEN_VERSION} VERSION_EQUAL ${Doxygen_FIND_VERSION})
+      message(FATAL_ERROR "Doxygen version found (${DOXYGEN_VERSION}) does not match the required one (${Doxygen_FIND_VERSION}), aborting.")
+    elseif(${DOXYGEN_VERSION} VERSION_LESS ${Doxygen_FIND_VERSION})
+      if(Doxygen_FIND_REQUIRED)
+        message(FATAL_ERROR "Doxygen version found (${DOXYGEN_VERSION}) is less then the minimum version required (${Doxygen_FIND_VERSION}), aborting.")
+      else(Doxygen_FIND_REQUIRED)
+        message("Doxygen version found (${DOXYGEN_VERSION}) is less then the minimum version required (${Doxygen_FIND_VERSION}), continue without Doxygen support.")
+        set(DOXYGEN_FOUND FALSE)
+      endif(Doxygen_FIND_REQUIRED)
+    endif()
+  endif(Doxygen_FIND_VERSION)
+endif(DOXYGEN_FOUND)
+
+#
 # Find Dot...
 #
 
