Skip to content
Snippets Groups Projects
Commit 8d18ea01 authored by Marco Clemencic's avatar Marco Clemencic
Browse files

made the use of local MathJax optional (off by default)

parent 5f2c16b2
No related branches found
Tags dox2
No related merge requests found
......@@ -38,6 +38,36 @@ Release notes of the packages:
set(DOXYGEN_HTML_EXTRA_FILES "${DOXYGEN_HTML_EXTRA_FILES} ${extra_file}")
endforeach()
# run Doxygen to generate the documentation
add_custom_target(run-doxygen
COMMAND ${env_cmd} --xml ${env_xml}
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
COMMENT "Running Doxygen...")
# 'doc' target
add_custom_target(doc DEPENDS run-doxygen)
option(DOXYGEN_WITH_LOCAL_MATHJAX
"Use a local copy of MathJax instead of taking it from cdn.mathjax.org"
FALSE)
if(DOXYGEN_WITH_LOCAL_MATHJAX)
# install MathJax Javascript math renderer
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/doxygen/mathjax
COMMAND ${CMAKE_COMMAND}
-DTARFILE_DEST=${CMAKE_CURRENT_BINARY_DIR}
-DINSTALL_DIR=${CMAKE_BINARY_DIR}/doxygen
-P ${CMAKE_CURRENT_SOURCE_DIR}/get_mathjax.cmake
COMMENT "Installing MathJax...")
# in principle this is not needed, but it allows to run Doxygen and install
# MathJax at the same time
add_custom_target(install-MathJax DEPENDS ${CMAKE_BINARY_DIR}/doxygen/mathjax)
add_dependencies(doc install-MathJax)
set(MATHJAX_RELPATH "../mathjax")
else()
set(MATHJAX_RELPATH "http://cdn.mathjax.org/mathjax/latest")
endif()
# massage some version numbers
string(REGEX REPLACE "_python.*" "" Boost_version "${Boost_config_version}")
string(REGEX REPLACE "\\." "_" Boost_url_version "${Boost_version}")
......@@ -48,23 +78,4 @@ Release notes of the packages:
configure_file(${template}.in ${CMAKE_CURRENT_BINARY_DIR}/${template} @ONLY)
endforeach()
# install MathJax Javascript math renderer
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/doxygen/mathjax
COMMAND ${CMAKE_COMMAND}
-DTARFILE_DEST=${CMAKE_CURRENT_BINARY_DIR}
-DINSTALL_DIR=${CMAKE_BINARY_DIR}/doxygen
-P ${CMAKE_CURRENT_SOURCE_DIR}/get_mathjax.cmake
COMMENT "Installing MathJax...")
# in principle this is not needed, but it allows to run Doxygen and install
# MathJax at the same time
add_custom_target(install-MathJax DEPENDS ${CMAKE_BINARY_DIR}/doxygen/mathjax)
# run Doxygen to generate the documentation
add_custom_target(run-doxygen
COMMAND ${env_cmd} --xml ${env_xml}
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
COMMENT "Running Doxygen...")
# 'doc' target
add_custom_target(doc DEPENDS run-doxygen install-MathJax)
endif()
......@@ -1437,7 +1437,7 @@ MATHJAX_FORMAT = HTML-CSS
# The default value is: http://cdn.mathjax.org/mathjax/latest.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_RELPATH = ../mathjax
MATHJAX_RELPATH = @MATHJAX_RELPATH@
# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
# extension names that should be enabled during MathJax rendering. For example
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment