Commit acab81bd authored by Jason Rhinelander's avatar Jason Rhinelander

Use local MathJax (if available)

Copied from eris.
parent 3592f546
......@@ -3,16 +3,32 @@
find_package(Doxygen 1.8.2 REQUIRED)
if(NOT DOXYGEN_DOT_FOUND)
message(FATAL_ERROR "Could NOT find dot (required by doxygen)")
message(FATAL_ERROR "Could NOT find dot (required for doxygen documentation generation)")
endif()
# Can set NO_MATHJAX to true to skip looking for the system MathJax, in which
# case the default (MathJax via public CDN) will be used by doxygen.
set(mathjax_usable_path "")
if (MATHJAX_PATH)
set(mathjax_usable_path "${MATHJAX_PATH}")
elseif (NOT NO_MATHJAX)
find_package(MathJax 2.3)
if(MATHJAX_FOUND)
set(mathjax_usable_path "${MATHJAX_PATH}")
else()
message(STATUS "System MathJax not found: using public MathJax CDN instead. If MathJax is installed, try setting MATHJAX_ROOT")
endif()
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
# Use a custom command to output doxygen's generated index file. Doing it this way ensures
# that 'make doc' only runs doxygen when something in src or include has changed.
# that 'make api_doc' only runs doxygen when something in src or include has changed.
add_custom_command(OUTPUT "api/index.html"
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
DEPENDS "Doxyfile.in" ${fracdist_headers} ${fracdist_source} data ${fracdist_data_generated}
${CMAKE_SOURCE_DIR}/README.md ${CMAKE_SOURCE_DIR}/CHANGELOG.md
${CMAKE_SOURCE_DIR}/BUILDING.md
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Generating API documentation (using doxygen)"
)
......@@ -25,5 +41,5 @@ set_property(DIRECTORY APPEND PROPERTY
add_dependencies(api_doc ${fracdist_data_generated})
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/api"
DESTINATION "${fracdist_docdir}"
DESTINATION ${CMAKE_INSTALL_DOCDIR}
COMPONENT docs)
......@@ -36,8 +36,7 @@ HAVE_DOT = YES
DOT_IMAGE_FORMAT = svg
USE_MATHJAX = YES
# Use default (cdn-hosted) MathJax
#MATHJAX_RELPATH =
MATHJAX_RELPATH = @mathjax_usable_path@
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment