You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
3.4 KiB

2 months ago
  1. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
  2. # #
  3. # File: doxygen-conf/CMakeLists.txt #
  4. # #
  5. # Project name: CARL #
  6. # Contact: Florian Corzilius <corzilius@cs.rwth-aachen.de>, #
  7. # Ulrich Loup <loup@cs.rwth-aachen.de> #
  8. # Project sourceforge page: http://smtrat.sourceforge.net/ #
  9. # Development status: beta #
  10. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
  11. # Version: 2012-02-21 #
  12. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
  13. # Quick self-configuration if only doc is built
  14. if("${PROJECT_NAME}" STREQUAL "")
  15. cmake_minimum_required (VERSION 2.8 FATAL_ERROR)
  16. project(CArL-doxygen NONE)
  17. set(CMAKE_CURRENT_BINARY_DIR "build")
  18. set(CMAKE_SOURCE_DIR "..")
  19. set(PROJECT_SOURCE_DIR "..")
  20. include(FindDoxygen)
  21. endif()
  22. # Cmake doxygen settings
  23. # # # # # # # # # # # # #
  24. option(DOCUMENTATION_CREATE_PDF "Create PDF reference manual" OFF )
  25. option(DOCUMENTATION_INCLUDE_SOURCE_REFERENCE "Include source reference in manual" ON)
  26. # Cmake modules needed
  27. # # # # # # # # # # # #
  28. find_package( HTMLHelp )
  29. find_package( LATEX )
  30. if( HTML_HELP_COMPILER )
  31. set(DOXYGEN_HTMLHELP YES )
  32. else( HTML_HELP_COMPILER )
  33. set(DOXYGEN_HTMLHELP NO )
  34. endif( HTML_HELP_COMPILER )
  35. if( LATEX_COMPILER OR PDFLATEX_COMPILER )
  36. set(DOXYGEN_LATEX YES )
  37. else( LATEX_COMPILER OR PDFLATEX_COMPILER )
  38. set(DOXYGEN_LATEX NO )
  39. endif( LATEX_COMPILER OR PDFLATEX_COMPILER )
  40. if( PDFLATEX_COMPILER AND DOCUMENTATION_CREATE_PDF )
  41. set(DOXYGEN_PDFLATEX YES )
  42. else( PDFLATEX_COMPILER AND DOCUMENTATION_CREATE_PDF )
  43. set(DOXYGEN_PDFLATEX NO )
  44. endif( PDFLATEX_COMPILER AND DOCUMENTATION_CREATE_PDF )
  45. if( DOCUMENTATION_CREATE_PDF )
  46. set(DOXYGEN_PDF_HYPERLINKS YES )
  47. else( DOCUMENTATION_CREATE_PDF )
  48. set(DOXYGEN_PDF_HYPERLINKS NO )
  49. endif( DOCUMENTATION_CREATE_PDF )
  50. if( DOT )
  51. set(HAVE_DOT YES )
  52. else( DOT )
  53. set(HAVE_DOT NO )
  54. endif( DOT )
  55. # Doxygen settings
  56. # # # # # # # # # #
  57. set(DOXYGEN_LANGUAGE "English" CACHE STRING "Language used by doxygen")
  58. mark_as_advanced(DOXYGEN_LANGUAGE)
  59. set(DOXYGEN_SOURCE_DIR ${PROJECT_SOURCE_DIR}/doc/markdown)
  60. if( DOCUMENTATION_INCLUDE_SOURCE_REFERENCE )
  61. set(DOXYGEN_SOURCE_DIR ${DOXYGEN_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/src)
  62. endif( DOCUMENTATION_INCLUDE_SOURCE_REFERENCE )
  63. set(DOXYGEN_OUTPUT_DIR ${PROJECT_BINARY_DIR}/doc)
  64. STRING(REGEX REPLACE ";" " " DOXYGEN_INPUT_LIST "${DOXYGEN_SOURCE_DIR}" )
  65. # Generate doxygen.conf
  66. # # # # # # # # # # # #
  67. configure_file(doxygen.conf.in ${CMAKE_CURRENT_BINARY_DIR}/doxygen.conf)
  68. # Target for running doxygen
  69. add_custom_target(doc-doxygen
  70. COMMAND Doxygen::doxygen ${CMAKE_CURRENT_BINARY_DIR}/doxygen.conf
  71. DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/doxygen.conf Doxygen::doxygen
  72. )
  73. # Target for building the whole documentation
  74. add_custom_target(doc
  75. DEPENDS doc-doxygen
  76. )
  77. if(DOXYGEN_PDFLATEX)
  78. set(TEX_DIR ${DOXYGEN_OUTPUT_DIR}/latex)
  79. add_custom_target(doc-pdf
  80. BYPRODUCTS ${TEX_DIR}/refman.pdf
  81. COMMAND ${PDFLATEX_COMPILER} refman.tex
  82. COMMAND ${PDFLATEX_COMPILER} refman.tex
  83. COMMAND mv ${TEX_DIR}/refman.pdf ${DOXYGEN_OUTPUT_DIR}/doc_${PROJECT_NAME}-${PROJECT_VERSION}.pdf
  84. WORKING_DIRECTORY ${TEX_DIR}
  85. DEPENDS doc-doxygen
  86. )
  87. add_dependencies(doc doc-pdf)
  88. endif(DOXYGEN_PDFLATEX)