Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9f84a42

Browse files
authored
Simplify the CMake doc targets (ROCm#154)
Now that we've dropped rocFile, there's no need for a CMake function to set up arbitrary library docs. This PR simplifies that documentation setup by assuming that we're only building hipFile docs. It also moves the setup from `docs/CMakeLists.txt` to `cmake/AISDocumentation.cmake`. There are some changes to the targets: * `hipfile-doc` no longer exists (just use `doc`) * The `doc` target only exists if `AIS_BUILD_DOCS` is set
1 parent 023d9f0 commit 9f84a42

6 files changed

Lines changed: 46 additions & 65 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
### Changed
77
* Renamed `hipFileOpStatusError()` to `hipFileGetOpErrorString()`
8+
* The `hipfile-doc` CMake target no longer exists (just use `doc`)
9+
* The `doc` CMake target only exists if the `AIS_BUILD_DOCS` option is enabled
810

911
### Removed
1012
* The rocFile library has been completely removed and the code is now a part of hipFile.

CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ option(AIS_BUILD_EXAMPLES "Build example programs" ON)
185185
#------
186186
# docs
187187
#------
188-
option(AIS_BUILD_DOCS "Build the hipFile docs (requires Doxygen)" OFF)
188+
include(AISDocumentation)
189189

190190
#-----------------------------------------------------------------------------
191191
# Find important packages for building the software
@@ -260,13 +260,6 @@ if(AIS_BUILD_EXAMPLES)
260260
add_subdirectory(examples/aiscp)
261261
endif()
262262

263-
#-----------------------------------------------------------------------------
264-
# Configure docs
265-
#-----------------------------------------------------------------------------
266-
if(AIS_BUILD_DOCS)
267-
add_subdirectory(docs)
268-
endif()
269-
270263
#-----------------------------------------------------------------------------
271264
# Set up installs (must come AFTER target creation)
272265
#-----------------------------------------------------------------------------

INSTALL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,6 @@ want a pdf, run `make pdf` in the `latex` directory, which will
121121
create a file named refman.pdf that you can rename.
122122

123123
If you want to build the docs without compiling the libraries,
124-
you can just build the `doc` target:
124+
you can just build the `doc` target (if you've set `AIS_BUILD_DOCS`):
125125

126126
`cmake --build . --target doc`

cmake/AISDocumentation.cmake

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Copyright (c) Advanced Micro Devices, Inc. All rights reserved.
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
#-----------------------------------------------------------------------------
6+
# Option to build the hipFile documentation
7+
#
8+
# TODO: Consider turning this into two options, one of which just requires
9+
# Doxygen and produces API docs, the other produces Sphinx/Breathe
10+
# output
11+
#-----------------------------------------------------------------------------
12+
option(AIS_BUILD_DOCS "Build the hipFile docs (requires Doxygen, Sphinx, and Breathe)" OFF)
13+
14+
if(AIS_BUILD_DOCS)
15+
find_package(Doxygen REQUIRED)
16+
17+
# Set Doxygen input (pasted into Doxyfile.in)
18+
set(AIS_DOXYFILE_INPUT "${CMAKE_SOURCE_DIR}/include")
19+
20+
# Set the path to the documentation
21+
set(AIS_DOC_PATH "${CMAKE_CURRENT_BINARY_DIR}/docs")
22+
23+
# Set the Doxyfile install location
24+
set(AIS_DOXYFILE ${AIS_DOC_PATH}/Doxyfile)
25+
26+
# Create the Doxyfile from the input file
27+
configure_file("docs/Doxyfile.in" ${AIS_DOXYFILE})
28+
29+
# Set the output directory
30+
set(DOXYGEN_OUT ${AIS_DOC_PATH})
31+
32+
# Configure the documentation build
33+
add_custom_target("doc"
34+
COMMAND ${DOXYGEN_EXECUTABLE} ${AIS_DOXYFILE}
35+
WORKING_DIRECTORY ${AIS_DOC_PATH}
36+
COMMENT "Generating hipFile API documentation with Doxygen"
37+
VERBATIM
38+
)
39+
40+
endif()

docs/CMakeLists.txt

Lines changed: 0 additions & 54 deletions
This file was deleted.

docs/Doxyfile.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ DOXYFILE_ENCODING = UTF-8
4242
# title of most generated pages and in a few other places.
4343
# The default value is: My Project.
4444

45-
PROJECT_NAME = "@AIS_DOXYFILE_PROJECT_NAME@"
45+
PROJECT_NAME = "hipFile"
4646

4747
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
4848
# could be handy for archiving the generated documentation or if some version
@@ -54,7 +54,7 @@ PROJECT_NUMBER = @AIS_LIBRARY_VERSION@
5454
# for a project that appears at the top of each page and should give viewer a
5555
# quick idea about the purpose of the project. Keep the description short.
5656

57-
PROJECT_BRIEF = @AIS_DOXYFILE_PROJECT_BRIEF@
57+
PROJECT_BRIEF = "hipFile API documentation"
5858

5959
# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
6060
# in the documentation. The maximum height of the logo should not exceed 55

0 commit comments

Comments
 (0)