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.

108 lines
4.0 KiB

  1. project(EigenDoc)
  2. set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL TRUE)
  3. project(EigenDoc)
  4. if(CMAKE_COMPILER_IS_GNUCXX)
  5. if(CMAKE_SYSTEM_NAME MATCHES Linux)
  6. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O1 -g1")
  7. endif(CMAKE_SYSTEM_NAME MATCHES Linux)
  8. endif(CMAKE_COMPILER_IS_GNUCXX)
  9. option(EIGEN_INTERNAL_DOCUMENTATION "Build internal documentation" OFF)
  10. # Set some Doxygen flags
  11. set(EIGEN_DOXY_PROJECT_NAME "Eigen")
  12. set(EIGEN_DOXY_OUTPUT_DIRECTORY_SUFFIX "")
  13. set(EIGEN_DOXY_INPUT "\"${Eigen_SOURCE_DIR}/Eigen\" \"${Eigen_SOURCE_DIR}/doc\"")
  14. set(EIGEN_DOXY_HTML_COLORSTYLE_HUE "220")
  15. set(EIGEN_DOXY_TAGFILES "")
  16. if(EIGEN_INTERNAL_DOCUMENTATION)
  17. set(EIGEN_DOXY_INTERNAL "YES")
  18. else(EIGEN_INTERNAL_DOCUMENTATION)
  19. set(EIGEN_DOXY_INTERNAL "NO")
  20. endif(EIGEN_INTERNAL_DOCUMENTATION)
  21. configure_file(
  22. ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
  23. ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
  24. )
  25. set(EIGEN_DOXY_PROJECT_NAME "Eigen-unsupported")
  26. set(EIGEN_DOXY_OUTPUT_DIRECTORY_SUFFIX "/unsupported")
  27. set(EIGEN_DOXY_INPUT "\"${Eigen_SOURCE_DIR}/unsupported/Eigen\" \"${Eigen_SOURCE_DIR}/unsupported/doc\"")
  28. set(EIGEN_DOXY_HTML_COLORSTYLE_HUE "0")
  29. # set(EIGEN_DOXY_TAGFILES "\"${Eigen_BINARY_DIR}/doc/eigen.doxytags =../\"")
  30. set(EIGEN_DOXY_TAGFILES "")
  31. configure_file(
  32. ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
  33. ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile-unsupported
  34. )
  35. configure_file(
  36. ${CMAKE_CURRENT_SOURCE_DIR}/eigendoxy_header.html.in
  37. ${CMAKE_CURRENT_BINARY_DIR}/eigendoxy_header.html
  38. )
  39. configure_file(
  40. ${CMAKE_CURRENT_SOURCE_DIR}/eigendoxy_footer.html.in
  41. ${CMAKE_CURRENT_BINARY_DIR}/eigendoxy_footer.html
  42. )
  43. configure_file(
  44. ${CMAKE_CURRENT_SOURCE_DIR}/eigendoxy_layout.xml.in
  45. ${CMAKE_CURRENT_BINARY_DIR}/eigendoxy_layout.xml
  46. )
  47. configure_file(
  48. ${Eigen_SOURCE_DIR}/unsupported/doc/eigendoxy_layout.xml.in
  49. ${Eigen_BINARY_DIR}/doc/unsupported/eigendoxy_layout.xml
  50. )
  51. set(examples_targets "")
  52. set(snippets_targets "")
  53. add_definitions("-DEIGEN_MAKING_DOCS")
  54. add_custom_target(all_examples)
  55. add_subdirectory(examples)
  56. add_subdirectory(special_examples)
  57. add_subdirectory(snippets)
  58. add_custom_target(
  59. doc-eigen-prerequisites
  60. ALL
  61. COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/html/
  62. COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/eigen_navtree_hacks.js ${CMAKE_CURRENT_BINARY_DIR}/html/
  63. COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Eigen_Silly_Professor_64x64.png ${CMAKE_CURRENT_BINARY_DIR}/html/
  64. COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/AsciiQuickReference.txt ${CMAKE_CURRENT_BINARY_DIR}/html/
  65. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  66. )
  67. add_custom_target(
  68. doc-unsupported-prerequisites
  69. ALL
  70. COMMAND ${CMAKE_COMMAND} -E make_directory ${Eigen_BINARY_DIR}/doc/html/unsupported
  71. COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/eigen_navtree_hacks.js ${CMAKE_CURRENT_BINARY_DIR}/html/unsupported/
  72. COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Eigen_Silly_Professor_64x64.png ${CMAKE_CURRENT_BINARY_DIR}/html/unsupported/
  73. WORKING_DIRECTORY ${Eigen_BINARY_DIR}/doc
  74. )
  75. add_dependencies(doc-eigen-prerequisites all_snippets all_examples)
  76. add_dependencies(doc-unsupported-prerequisites unsupported_snippets unsupported_examples)
  77. add_custom_target(doc ALL
  78. COMMAND doxygen
  79. COMMAND doxygen Doxyfile-unsupported
  80. COMMAND ${CMAKE_COMMAND} -E copy ${Eigen_BINARY_DIR}/doc/html/group__TopicUnalignedArrayAssert.html ${Eigen_BINARY_DIR}/doc/html/TopicUnalignedArrayAssert.html
  81. COMMAND ${CMAKE_COMMAND} -E rename html eigen-doc
  82. COMMAND ${CMAKE_COMMAND} -E remove eigen-doc/eigen-doc.tgz
  83. COMMAND ${CMAKE_COMMAND} -E tar cfz eigen-doc.tgz eigen-doc
  84. COMMAND ${CMAKE_COMMAND} -E rename eigen-doc.tgz eigen-doc/eigen-doc.tgz
  85. COMMAND ${CMAKE_COMMAND} -E rename eigen-doc html
  86. WORKING_DIRECTORY ${Eigen_BINARY_DIR}/doc)
  87. add_dependencies(doc doc-eigen-prerequisites doc-unsupported-prerequisites)