2019-08-17 03:22:54 +00:00
|
|
|
set(BUILD_BREATHE_DOC OFF CACHE STRING "Enable documntation in Breathe format")
|
|
|
|
set_property(CACHE BUILD_BREATHE_DOC PROPERTY STRINGS ON OFF)
|
2019-03-31 10:52:29 +00:00
|
|
|
|
2019-08-17 03:22:54 +00:00
|
|
|
function(add_breathe_target)
|
|
|
|
if(BUILD_BREATHE_DOC)
|
|
|
|
find_package(Doxygen REQUIRED)
|
|
|
|
find_package(Perl REQUIRED)
|
|
|
|
set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 3.4 3.3 3.2)
|
|
|
|
find_package(PythonInterp REQUIRED)
|
|
|
|
find_package(Sphinx REQUIRED)
|
2019-04-15 00:55:20 +00:00
|
|
|
include(FindPythonModule)
|
2019-08-17 03:22:54 +00:00
|
|
|
find_python_module(breathe REQUIRED)
|
|
|
|
find_python_module(recommonmark REQUIRED)
|
2019-02-20 20:25:23 +00:00
|
|
|
|
2019-03-31 10:52:29 +00:00
|
|
|
set(options)
|
2019-08-17 03:22:54 +00:00
|
|
|
set(oneValueArgs SOURCE_DIR BUILD_DIR CACHE_DIR HTML_DIR DOXY_FILE CONF_FILE TARGET_NAME COMMENT)
|
2019-03-31 10:52:29 +00:00
|
|
|
set(multiValueArgs)
|
2019-02-20 20:25:23 +00:00
|
|
|
|
2019-08-17 03:22:54 +00:00
|
|
|
cmake_parse_arguments(_BREATHE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
2019-02-20 20:25:23 +00:00
|
|
|
|
2019-08-17 03:22:54 +00:00
|
|
|
configure_file(${_BREATHE_CONF_FILE} ${_BREATHE_BUILD_DIR}/conf.py @ONLY)
|
|
|
|
configure_file(${_BREATHE_DOXY_FILE} ${_BREATHE_BUILD_DIR}/Doxyfile @ONLY)
|
2019-02-20 20:25:23 +00:00
|
|
|
|
2019-08-17 03:36:47 +00:00
|
|
|
add_custom_target(${_BREATHE_TARGET_NAME} VERBATIM
|
2019-08-17 03:22:54 +00:00
|
|
|
COMMAND ${SPHINX_EXECUTABLE} -q -b html -c ${_BREATHE_BUILD_DIR}
|
|
|
|
-d ${_BREATHE_CACHE_DIR}
|
|
|
|
${_BREATHE_SOURCE_DIR}
|
|
|
|
${_BREATHE_HTML_DIR}
|
|
|
|
COMMENT "Building ${_BREATHE_TARGET_NAME} documentation with Breathe"
|
2019-03-31 10:52:29 +00:00
|
|
|
)
|
|
|
|
endif()
|
2019-02-20 20:25:23 +00:00
|
|
|
endfunction()
|