CMakeLists.txt 1.78 KB
Newer Older
Paul's avatar
Paul committed
1
2
3
4
5
6
7
8

include(DoxygenDoc)

set(DOXYGEN_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/doxygen/)
add_doxygen_doc(
    OUTPUT_DIRECTORY ${DOXYGEN_OUTPUT}
    INPUT 
        ${CMAKE_CURRENT_SOURCE_DIR}/../src
Paul's avatar
Paul committed
9
10
11
12
13
    INCLUDE_PATH
        ${CMAKE_CURRENT_SOURCE_DIR}/../src/include
        ${CMAKE_CURRENT_SOURCE_DIR}/../src/targets/cpu/include
        ${CMAKE_CURRENT_SOURCE_DIR}/../src/targets/gpu/include
    SEARCH_INCLUDES YES
Paul's avatar
Paul committed
14
15
16
17
18
19
20
21
    MACRO_EXPANSION YES
    RECURSIVE YES
    GENERATE_XML YES
    GENERATE_LATEX YES
    USE_PDFLATEX YES
    CALL_GRAPH YES
    CALLER_GRAPH YES
    BUILTIN_STL_SUPPORT YES
Paul's avatar
Paul committed
22
    PROJECT_NAME MIGraphX
Paul's avatar
Paul committed
23
24
25
26
27
28
29
30
    SORT_MEMBERS_CTORS_1ST YES
    SOURCE_BROWSER YES
    GENERATE_TREEVIEW YES
    REFERENCED_BY_RELATION YES
    REFERENCES_RELATION YES
    REFERENCES_LINK_SOURCE YES
    EXTRACT_ALL YES
    ENUM_VALUES_PER_LINE 1
Paul's avatar
Paul committed
31
    FULL_PATH_NAMES YES
Paul's avatar
Paul committed
32
    PREDEFINED DOXYGEN
Paul's avatar
Paul committed
33
)
Paul's avatar
Paul committed
34
35
36
37
add_custom_target(remove_inline_ns 
    sed -i "s/MIGRAPH_INLINE_NS:://g" *.xml 
    WORKING_DIRECTORY ${DOXYGEN_OUTPUT}/xml)
add_dependencies(remove_inline_ns doxygen)
Paul's avatar
Paul committed
38

Paul's avatar
Paul committed
39
40
41
42
43
44
45
include(SphinxDoc)
add_sphinx_doc(src 
    BUILDER html 
    OUTPUT_DIR html 
    VARS 
        breathe_projects.proj=${DOXYGEN_OUTPUT}/xml
        breathe_default_project=proj
Paul's avatar
Paul committed
46
    DEPENDS doxygen remove_inline_ns
Paul's avatar
Paul committed
47
)
Paul's avatar
Paul committed
48

Paul's avatar
Paul committed
49
50
51
52
53
54
55
56
57
58
59
60
61
62
find_package(LATEX)
if(LATEX_FOUND)
    add_sphinx_doc(src 
        BUILDER latex
        OUTPUT_DIR pdf
        VARS 
            breathe_projects.proj=${DOXYGEN_OUTPUT}/xml
            breathe_default_project=proj
        DEPENDS doxygen
    )
else()
    message("Latex builder not found. Latex builder is required only for building the PDF documentation for MIGraph and is not necessary for building the library, or any other components. To build PDF documentation run make in ${CMAKE_CURRENT_SOURCE_DIR}/pdf, once a latex builder is installed.")
endif()