FindDoxygen.cmake 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. # - This module looks for Doxygen and the path to Graphiz's dot
  2. # Doxygen is a documentation generation tool see http://www.doxygen.org
  3. # With the OS X GUI version, it likes to be installed to /Applications and
  4. # it contains the doxygen executable in the bundle. In the versions I've
  5. # seen, it is located in Resources, but in general, more often binaries are
  6. # located in MacOS.
  7. # The official Doxygen.app that is distributed for OS X uses non-standard
  8. # conventions. Instead of the command-line "doxygen" tool being placed in
  9. # Doxygen.app/Contents/MacOS, "Doxywizard" is placed there instead and
  10. # "doxygen" is actually placed in Contents/Resources. This is most likely
  11. # to accomodate people who double-click on the Doxygen.app package and expect
  12. # to see something happen. However, the CMake backend gets horribly confused
  13. # by this. Once CMake sees the bundle, it indiscrimately uses Doxywizard
  14. # as the executable to use. The only work-around I have found is to disable
  15. # the app-bundle feature for only this command.
  16. # Save the old setting
  17. SET(TEMP_DOXYGEN_SAVE_CMAKE_FIND_APPBUNDLE ${CMAKE_FIND_APPBUNDLE})
  18. # Disable the App-bundle detection feature
  19. SET(CMAKE_FIND_APPBUNDLE "NEVER")
  20. IF (NOT DOXYGEN_FIND_QUIETLY)
  21. MESSAGE(STATUS "Looking for doxygen...")
  22. ENDIF (NOT DOXYGEN_FIND_QUIETLY)
  23. FIND_PROGRAM(DOXYGEN_EXECUTABLE
  24. NAMES doxygen
  25. PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\doxygen_is1;Inno Setup: App Path]/bin"
  26. /Applications/Doxygen.app/Contents/Resources
  27. /Applications/Doxygen.app/Contents/MacOS
  28. DOC "Doxygen documentation generation tool (http://www.doxygen.org)"
  29. )
  30. IF (DOXYGEN_EXECUTABLE)
  31. SET (DOXYGEN_FOUND "YES")
  32. IF (NOT DOXYGEN_FIND_QUIETLY)
  33. MESSAGE(STATUS "Looking for doxygen... - found ${DOXYGEN_EXECUTABLE}")
  34. ENDIF (NOT DOXYGEN_FIND_QUIETLY)
  35. ELSE (DOXYGEN_EXECUTABLE)
  36. IF (NOT DOXYGEN_FIND_QUIETLY)
  37. IF (DOXYGEN_FIND_REQUIRED)
  38. MESSAGE(FATAL_ERROR "Looking for doxygen... - NOT found")
  39. ELSE (DOXYGEN_FIND_REQUIRED)
  40. MESSAGE(STATUS "Looking for doxygen... - NOT found")
  41. ENDIF (DOXYGEN_FIND_REQUIRED)
  42. ENDIF (NOT DOXYGEN_FIND_QUIETLY)
  43. ENDIF (DOXYGEN_EXECUTABLE)
  44. # In the older versions of OS X Doxygen, dot was included with the
  45. # Doxygen bundle. But the new versions place make you download Graphviz.app
  46. # which contains dot in its bundle.
  47. IF (NOT DOXYGEN_FIND_QUIETLY)
  48. MESSAGE(STATUS "Looking for dot tool...")
  49. ENDIF (NOT DOXYGEN_FIND_QUIETLY)
  50. FIND_PROGRAM(DOXYGEN_DOT_EXECUTABLE
  51. NAMES dot
  52. PATHS "$ENV{ProgramFiles}/ATT/Graphviz/bin"
  53. "C:/Program Files/ATT/Graphviz/bin"
  54. [HKEY_LOCAL_MACHINE\\SOFTWARE\\ATT\\Graphviz;InstallPath]/bin
  55. /Applications/Graphviz.app/Contents/MacOS
  56. /Applications/Doxygen.app/Contents/Resources
  57. /Applications/Doxygen.app/Contents/MacOS
  58. DOC "Graphiz Dot tool for using Doxygen"
  59. )
  60. IF (NOT DOXYGEN_FIND_QUIETLY)
  61. IF (DOXYGEN_DOT_EXECUTABLE)
  62. MESSAGE(STATUS "Looking for dot tool... - found ${DOXYGEN_DOT_EXECUTABLE}")
  63. ELSE (DOXYGEN_DOT_EXECUTABLE)
  64. MESSAGE(STATUS "Looking for dot tool... - NOT found")
  65. ENDIF (DOXYGEN_DOT_EXECUTABLE)
  66. ENDIF (NOT DOXYGEN_FIND_QUIETLY)
  67. # The Doxyfile wants the path to Dot, not the entire path and executable
  68. # so for convenience, I'll add another search for DOXYGEN_DOT_PATH.
  69. FIND_PATH(DOXYGEN_DOT_PATH
  70. dot
  71. "C:/Program Files/ATT/Graphviz/bin"
  72. [HKEY_LOCAL_MACHINE\\SOFTWARE\\ATT\\Graphviz;InstallPath]/bin
  73. /Applications/Graphviz.app/Contents/MacOS
  74. /Applications/Doxygen.app/Contents/Resources
  75. /Applications/Doxygen.app/Contents/MacOS
  76. DOC "Path to the Graphviz Dot tool"
  77. )
  78. # Restore the old app-bundle setting setting
  79. SET(CMAKE_FIND_APPBUNDLE ${TEMP_DOXYGEN_SAVE_CMAKE_FIND_APPBUNDLE})
  80. MARK_AS_ADVANCED(
  81. DOXYGEN_FOUND,
  82. DOXYGEN_EXECUTABLE,
  83. DOXYGEN_DOT_FOUND,
  84. DOXYGEN_DOT_EXECUTABLE,
  85. DOXYGEN_DOT_PATH,
  86. )