CMakeLists.txt 3.27 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#####################################################################################
# The MIT License (MIT)
#
# Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#####################################################################################
24
25
26
27
project(migraphx-doc)
find_package(ROCM REQUIRED)

include(ROCMDoxygenDoc)
Paul's avatar
Paul committed
28

29
set(DOXYGEN_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/doxygen)
30
rocm_add_doxygen_doc(
Paul's avatar
Paul committed
31
32
    OUTPUT_DIRECTORY ${DOXYGEN_OUTPUT}
    INPUT 
33
        ${CMAKE_SOURCE_DIR}/src
Paul's avatar
Paul committed
34
    INCLUDE_PATH
35
36
37
        ${CMAKE_SOURCE_DIR}/src/include
        ${CMAKE_SOURCE_DIR}/src/targets/cpu/include
        ${CMAKE_SOURCE_DIR}/src/targets/gpu/include
Paul's avatar
Paul committed
38
    STRIP_FROM_INC_PATH
39
40
41
        ${CMAKE_SOURCE_DIR}/src/include
        ${CMAKE_SOURCE_DIR}/src/targets/cpu/include
        ${CMAKE_SOURCE_DIR}/src/targets/gpu/include
42
    EXCLUDE_PATTERNS
43
44
        ${CMAKE_SOURCE_DIR}/src/targets/gpu/kernels
        ${CMAKE_SOURCE_DIR}/src/targets/gpu/device
Paul's avatar
Paul committed
45
    SEARCH_INCLUDES YES
Paul's avatar
Paul committed
46
47
48
49
50
51
52
53
    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
54
    PROJECT_NAME MIGraphX
Paul's avatar
Paul committed
55
56
57
58
59
60
61
62
    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
63
    FULL_PATH_NAMES YES
64
    WARN_LOGFILE "${DOXYGEN_OUTPUT}/DoxygenWarningLog.txt"
Paul's avatar
Paul committed
65
    PREDEFINED DOXYGEN
Paul's avatar
Paul committed
66
67
)

68
69
include(ROCMSphinxDoc)
rocm_add_sphinx_doc(src 
Paul's avatar
Paul committed
70
    BUILDER html 
71
    OUTPUT_DIR html
Paul's avatar
Paul committed
72
73
74
    VARS 
        breathe_projects.proj=${DOXYGEN_OUTPUT}/xml
        breathe_default_project=proj
75
    DEPENDS doxygen
Paul's avatar
Paul committed
76
)
Paul's avatar
Paul committed
77

Paul's avatar
Paul committed
78
79
find_package(LATEX)
if(LATEX_FOUND)
80
    rocm_add_sphinx_doc(src 
Paul's avatar
Paul committed
81
82
83
84
85
86
87
88
        BUILDER latex
        OUTPUT_DIR pdf
        VARS 
            breathe_projects.proj=${DOXYGEN_OUTPUT}/xml
            breathe_default_project=proj
        DEPENDS doxygen
    )
else()
89
    message("Latex builder not found. Latex builder is required only for building the PDF documentation for MIGraphX 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.")
Paul's avatar
Paul committed
90
91
endif()