FindDoxygen.cmake 4.3 KB

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