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

include(DoxygenDoc)

set(DOXYGEN_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/doxygen/)
add_doxygen_doc(
    OUTPUT_DIRECTORY ${DOXYGEN_OUTPUT}
    INPUT 
8
        ${PROJECT_SOURCE_DIR}/src
Paul's avatar
Paul committed
9
    INCLUDE_PATH
10
11
12
13
14
15
16
        ${PROJECT_SOURCE_DIR}/src/include
        ${PROJECT_SOURCE_DIR}/src/targets/cpu/include
        ${PROJECT_SOURCE_DIR}/src/targets/gpu/include
    STRIP_FROM_INC_PATH
        ${PROJECT_SOURCE_DIR}/src/include
        ${PROJECT_SOURCE_DIR}/src/targets/cpu/include
        ${PROJECT_SOURCE_DIR}/src/targets/gpu/include
Paul's avatar
Paul committed
17
    SEARCH_INCLUDES YES
Paul's avatar
Paul committed
18
19
20
21
22
23
24
25
    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
26
    PROJECT_NAME MIGraphX
Paul's avatar
Paul committed
27
28
29
30
31
32
33
34
    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
35
    FULL_PATH_NAMES YES
Paul's avatar
Paul committed
36
    PREDEFINED DOXYGEN
Paul's avatar
Paul committed
37
)
Paul's avatar
Paul committed
38
add_custom_target(remove_inline_ns 
Paul's avatar
Paul committed
39
    sed -i "s/MIGRAPHX_INLINE_NS:://g" *.xml 
Paul's avatar
Paul committed
40
41
    WORKING_DIRECTORY ${DOXYGEN_OUTPUT}/xml)
add_dependencies(remove_inline_ns doxygen)
Paul's avatar
Paul committed
42

Paul's avatar
Paul committed
43
44
45
46
47
48
49
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
50
    DEPENDS doxygen remove_inline_ns
Paul's avatar
Paul committed
51
)
Paul's avatar
Paul committed
52

Paul's avatar
Paul committed
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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()