FindDoxygen.cmake 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. # - This module looks for Doxygen and the path to Graphviz's dot
  2. # Doxygen is a documentation generation tool see http://www.doxygen.org
  3. #
  4. # This module accepts the following optional variables:
  5. #
  6. # DOXYGEN_SKIP_DOT = If true this module will skip trying to find Dot
  7. #
  8. # This modules defines the following variables:
  9. #
  10. # DOXYGEN_EXECUTABLE = The path to the doxygen command.
  11. # DOXYGEN_FOUND = Was Doxygen found or not?
  12. #
  13. # DOXYGEN_DOT_EXECUTABLE = The path to the dot program used by doxygen.
  14. # DOXYGEN_DOT_FOUND = Was Dot found or not?
  15. # DOXYGEN_DOT_PATH = The path to dot not including the executable
  16. #
  17. # Details for OSX Users:
  18. # With the OS X GUI version, it likes to be installed to /Applications and
  19. # it contains the doxygen executable in the bundle. In the versions I've
  20. # seen, it is located in Resources, but in general, more often binaries are
  21. # located in MacOS.
  22. #
  23. # The official Doxygen.app that is distributed for OS X uses non-standard
  24. # conventions. Instead of the command-line "doxygen" tool being placed in
  25. # Doxygen.app/Contents/MacOS, "Doxywizard" is placed there instead and
  26. # "doxygen" is actually placed in Contents/Resources. This is most likely
  27. # to accomodate people who double-click on the Doxygen.app package and expect
  28. # to see something happen. However, the CMake backend gets horribly confused
  29. # by this. Once CMake sees the bundle, it indiscrimately uses Doxywizard
  30. # as the executable to use. The only work-around I have found is to disable
  31. # the app-bundle feature for only this command.
  32. if(APPLE)
  33. # Save the old setting
  34. SET(TEMP_DOXYGEN_SAVE_CMAKE_FIND_APPBUNDLE ${CMAKE_FIND_APPBUNDLE})
  35. # Disable the App-bundle detection feature
  36. SET(CMAKE_FIND_APPBUNDLE "NEVER")
  37. endif()
  38. # FYI:
  39. # In the older versions of OS X Doxygen, dot was included with the
  40. # Doxygen bundle. But the new versions place make you download Graphviz.app
  41. # which contains dot in its bundle.
  42. # ============== End OSX stuff ================
  43. # For backwards compatibility support
  44. # DOXYGEN_FIND_QUIETLY, but it should have been
  45. # Doxygen_FIND_QUIETLY.
  46. IF(Doxygen_FIND_QUIETLY)
  47. SET(DOXYGEN_FIND_QUIETLY TRUE)
  48. ENDIF(Doxygen_FIND_QUIETLY)
  49. #
  50. # Find Doxygen...
  51. #
  52. FIND_PROGRAM(DOXYGEN_EXECUTABLE
  53. NAMES doxygen
  54. PATHS
  55. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\doxygen_is1;Inno Setup: App Path]/bin"
  56. /Applications/Doxygen.app/Contents/Resources
  57. /Applications/Doxygen.app/Contents/MacOS
  58. DOC "Doxygen documentation generation tool (http://www.doxygen.org)"
  59. )
  60. include(FindPackageHandleStandardArgs)
  61. FIND_PACKAGE_HANDLE_STANDARD_ARGS(DOXYGEN DEFAULT_MSG DOXYGEN_EXECUTABLE)
  62. #
  63. # Find Dot...
  64. #
  65. IF(NOT DOXYGEN_SKIP_DOT)
  66. FIND_PROGRAM(DOXYGEN_DOT_EXECUTABLE
  67. NAMES dot
  68. PATHS
  69. "$ENV{ProgramFiles}/Graphviz 2.21/bin"
  70. "C:/Program Files/Graphviz 2.21/bin"
  71. "$ENV{ProgramFiles}/ATT/Graphviz/bin"
  72. "C:/Program Files/ATT/Graphviz/bin"
  73. [HKEY_LOCAL_MACHINE\\SOFTWARE\\ATT\\Graphviz;InstallPath]/bin
  74. /Applications/Graphviz.app/Contents/MacOS
  75. /Applications/Doxygen.app/Contents/Resources
  76. /Applications/Doxygen.app/Contents/MacOS
  77. DOC "Graphviz Dot tool for using Doxygen"
  78. )
  79. include(FindPackageHandleStandardArgs)
  80. FIND_PACKAGE_HANDLE_STANDARD_ARGS(DOXYGEN_DOT DEFAULT_MSG DOXYGEN_DOT_EXECUTABLE)
  81. if(DOXYGEN_DOT_EXECUTABLE)
  82. # The Doxyfile wants the path to Dot, not the entire path and executable
  83. get_filename_component(DOXYGEN_DOT_PATH "${DOXYGEN_DOT_EXECUTABLE}" PATH CACHE)
  84. endif()
  85. endif(NOT DOXYGEN_SKIP_DOT)
  86. #
  87. # Backwards compatibility...
  88. #
  89. if(APPLE)
  90. # Restore the old app-bundle setting setting
  91. SET(CMAKE_FIND_APPBUNDLE ${TEMP_DOXYGEN_SAVE_CMAKE_FIND_APPBUNDLE})
  92. endif()
  93. # Maintain the _FOUND variables as "YES" or "NO" for backwards compatibility
  94. # (allows people to stuff them directly into Doxyfile with configure_file())
  95. if(DOXYGEN_FOUND)
  96. set(DOXYGEN_FOUND "YES")
  97. else()
  98. set(DOXYGEN_FOUND "NO")
  99. endif()
  100. if(DOXYGEN_DOT_FOUND)
  101. set(DOXYGEN_DOT_FOUND "YES")
  102. else()
  103. set(DOXYGEN_DOT_FOUND "NO")
  104. endif()
  105. # Backwards compatibility for CMake4.3 and less
  106. SET (DOXYGEN ${DOXYGEN_EXECUTABLE} )
  107. SET (DOT ${DOXYGEN_DOT_EXECUTABLE} )
  108. MARK_AS_ADVANCED(
  109. DOXYGEN_EXECUTABLE
  110. DOXYGEN_DOT_EXECUTABLE
  111. DOXYGEN_DOT_PATH
  112. )