File: CMakeLists.txt

package info (click to toggle)
ismrmrd 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,408 kB
  • sloc: cpp: 12,225; ansic: 2,449; xml: 453; python: 42; makefile: 15
file content (39 lines) | stat: -rw-r--r-- 1,584 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
add_custom_target(doc)
find_package(Doxygen)
if(DOXYGEN_FOUND)
    set(API_DOC_DIR ${CMAKE_CURRENT_BINARY_DIR}/html/api)
    set(DOXYFILE ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)

    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${DOXYFILE} @ONLY)

    add_custom_target(apidoc
        COMMAND ${CMAKE_COMMAND} -E make_directory ${API_DOC_DIR}
        COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE}
        COMMENT "Generating API documentation using Doxygen" VERBATIM)
    add_dependencies(doc apidoc)
else()
    message(STATUS "Doxygen not found. Not able to build API documentation")
endif()

find_program(SPHINXBUILD sphinx-build)
if(SPHINXBUILD)
    if(WIN32)
        set(SPHINX_MAKEBAT ${CMAKE_CURRENT_BINARY_DIR}/make.sphinx.bat)
        configure_file(make.sphinx.bat.in ${SPHINX_MAKEBAT} @ONLY)
        add_custom_target(htmldoc
            COMMAND ${SPHINX_MAKEBAT} html
            COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/html/.nojekyll
            COMMENT "Generating HTML docs using Sphinx" VERBATIM)
    else()
        set(SPHINX_MAKEFILE ${CMAKE_CURRENT_BINARY_DIR}/Makefile.sphinx)
        configure_file(Makefile.sphinx.in ${SPHINX_MAKEFILE} @ONLY)
        add_custom_target(htmldoc
            COMMAND make -f ${SPHINX_MAKEFILE} html
            COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/html/.nojekyll
            COMMENT "Generating HTML docs using Sphinx" VERBATIM)
    endif()
    add_dependencies(doc htmldoc)
else()
    message(STATUS "sphinx-build not found. Not able to build HTML project documentation")
endif()