Compare commits
No commits in common. "3654fd719eb97bdfd2142ecabce9464b3e1e9b9c" and "21595e38909ff1efd26001d8e9f3396a7ed060b1" have entirely different histories.
3654fd719e
...
21595e3890
@ -1,8 +1,25 @@
|
|||||||
set(BUILD_BREATHE_DOC OFF CACHE STRING "Enable documntation in Breathe format")
|
set(BUILD_BREATHE_DOC AUTO CACHE STRING "Enable documntation in Breathe format")
|
||||||
set_property(CACHE BUILD_BREATHE_DOC PROPERTY STRINGS ON OFF)
|
set_property(CACHE BUILD_BREATHE_DOC PROPERTY STRINGS AUTO ON OFF)
|
||||||
|
|
||||||
function(add_breathe_target)
|
if(BUILD_BREATHE_DOC STREQUAL AUTO)
|
||||||
if(BUILD_BREATHE_DOC)
|
find_package(Doxygen)
|
||||||
|
find_package(Perl)
|
||||||
|
set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 3.4 3.3 3.2)
|
||||||
|
find_package(PythonInterp)
|
||||||
|
if (PYTHONINTERP_FOUND)
|
||||||
|
find_package(Sphinx)
|
||||||
|
include(FindPythonModule)
|
||||||
|
find_python_module(breathe)
|
||||||
|
find_python_module(recommonmark)
|
||||||
|
if(DOXYGEN_FOUND AND PERL_FOUND AND PYTHONINTERP_FOUND AND SPHINX_FOUND AND breathe_FOUND AND recommonmark_FOUND)
|
||||||
|
set(BUILD_BREATHE_DOC ON CACHE STRING "Enable documntation in Breathe format" FORCE)
|
||||||
|
else()
|
||||||
|
set(BUILD_BREATHE_DOC OFF CACHE STRING "Disable documentation in Breathe format" FORCE)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(BUILD_BREATHE_DOC OFF CACHE STRING "Disable documentation in Breathe format" FORCE)
|
||||||
|
endif()
|
||||||
|
elseif(BUILD_BREATHE_DOC)
|
||||||
find_package(Doxygen REQUIRED)
|
find_package(Doxygen REQUIRED)
|
||||||
find_package(Perl REQUIRED)
|
find_package(Perl REQUIRED)
|
||||||
set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 3.4 3.3 3.2)
|
set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 3.4 3.3 3.2)
|
||||||
@ -11,22 +28,58 @@ function(add_breathe_target)
|
|||||||
include(FindPythonModule)
|
include(FindPythonModule)
|
||||||
find_python_module(breathe REQUIRED)
|
find_python_module(breathe REQUIRED)
|
||||||
find_python_module(recommonmark REQUIRED)
|
find_python_module(recommonmark REQUIRED)
|
||||||
|
set(BUILD_BREATHE_DOC ON CACHE STRING "Enable documentation in Breathe format" FORCE)
|
||||||
|
else()
|
||||||
|
set(BUILD_BREATHE_DOC OFF CACHE STRING "Disable documentation in Breathe format" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
function(add_breathe_doc)
|
||||||
|
if(BUILD_BREATHE_DOC AND CMAKE_BUILD_TYPE STREQUAL Release)
|
||||||
set(options)
|
set(options)
|
||||||
set(oneValueArgs SOURCE_DIR BUILD_DIR CACHE_DIR HTML_DIR DOXY_FILE CONF_FILE TARGET_NAME COMMENT)
|
set(oneValueArgs
|
||||||
|
SOURCE_DIR
|
||||||
|
BUILD_DIR
|
||||||
|
CACHE_DIR
|
||||||
|
HTML_DIR
|
||||||
|
DOXY_FILE
|
||||||
|
CONF_FILE
|
||||||
|
TARGET_NAME
|
||||||
|
COMMENT
|
||||||
|
)
|
||||||
set(multiValueArgs)
|
set(multiValueArgs)
|
||||||
|
|
||||||
cmake_parse_arguments(_BREATHE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
cmake_parse_arguments(BREATHE_DOC
|
||||||
|
"${options}"
|
||||||
|
"${oneValueArgs}"
|
||||||
|
"${multiValueArgs}"
|
||||||
|
${ARGN}
|
||||||
|
)
|
||||||
|
|
||||||
configure_file(${_BREATHE_CONF_FILE} ${_BREATHE_BUILD_DIR}/conf.py @ONLY)
|
configure_file(
|
||||||
configure_file(${_BREATHE_DOXY_FILE} ${_BREATHE_BUILD_DIR}/Doxyfile @ONLY)
|
${BREATHE_DOC_CONF_FILE}
|
||||||
|
${BREATHE_DOC_BUILD_DIR}/conf.py
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
|
||||||
add_custom_target(${_BREATHE_TARGET_NAME} ALL VERBATIM
|
configure_file(
|
||||||
COMMAND ${SPHINX_EXECUTABLE} -q -b html -c ${_BREATHE_BUILD_DIR}
|
${BREATHE_DOC_DOXY_FILE}
|
||||||
-d ${_BREATHE_CACHE_DIR}
|
${BREATHE_DOC_BUILD_DIR}/Doxyfile
|
||||||
${_BREATHE_SOURCE_DIR}
|
@ONLY
|
||||||
${_BREATHE_HTML_DIR}
|
)
|
||||||
COMMENT "Building ${_BREATHE_TARGET_NAME} documentation with Breathe"
|
|
||||||
|
add_custom_target(${BREATHE_DOC_TARGET_NAME}
|
||||||
|
ALL
|
||||||
|
COMMAND
|
||||||
|
${SPHINX_EXECUTABLE}
|
||||||
|
-q
|
||||||
|
-b html
|
||||||
|
-c ${BREATHE_DOC_BUILD_DIR}
|
||||||
|
-d ${BREATHE_DOC_CACHE_DIR}
|
||||||
|
${BREATHE_DOC_SOURCE_DIR}
|
||||||
|
${BREATHE_DOC_HTML_DIR}
|
||||||
|
COMMENT
|
||||||
|
"Building ${BREATHE_DOC_TARGET_NAME} documentation with Breathe, Sphinx and Doxygen"
|
||||||
|
VERBATIM
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
@ -39,7 +39,6 @@ include(CMLibSanitizers)
|
|||||||
include(cotire)
|
include(cotire)
|
||||||
|
|
||||||
include(CMLibFormatSources)
|
include(CMLibFormatSources)
|
||||||
include(CMLibDoxygen)
|
|
||||||
include(CMLibBreathe)
|
include(CMLibBreathe)
|
||||||
include(CMLibQtTranslation)
|
include(CMLibQtTranslation)
|
||||||
include(CMLibToday)
|
include(CMLibToday)
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
option(BUILD_DOXYGEN_DOC "Build documentation with Doxygen" OFF)
|
|
||||||
set_property(CACHE BUILD_DOXYGEN_DOC PROPERTY STRINGS ON OFF)
|
|
||||||
|
|
||||||
function(add_doxygen_target)
|
|
||||||
if (BUILD_DOXYGEN_DOC)
|
|
||||||
find_package(Doxygen REQUIRED)
|
|
||||||
|
|
||||||
set(options)
|
|
||||||
set(oneValueArgs TARGET_NAME IN OUT)
|
|
||||||
set(multiValueArgs)
|
|
||||||
|
|
||||||
cmake_parse_arguments(_DOXYGEN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
|
||||||
|
|
||||||
configure_file(${_DOXYGEN_IN} ${_DOXYGEN_OUT} @ONLY)
|
|
||||||
message("Doxygen build started")
|
|
||||||
|
|
||||||
add_custom_target(${_DOXYGEN_TARGET}
|
|
||||||
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
||||||
COMMENT "Generating API documentation with Doxygen"
|
|
||||||
VERBATIM )
|
|
||||||
endif()
|
|
||||||
endfunction()
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user