File: ManageAPIDoc.cmake

package info (click to toggle)
ibus-table-chinese 1.8.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 29,812 kB
  • sloc: sh: 106; makefile: 11
file content (50 lines) | stat: -rw-r--r-- 1,766 bytes parent folder | download | duplicates (4)
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
40
41
42
43
44
45
46
47
48
49
50
# - Mage generated API documents
# This module is for API document generation, such as doxygen.
# Defines following macros:
#   MANAGE_APIDOC_DOXYGEN(doxygen_in doc_dir)
#   - This macro generate documents according to doxygen template.
#     Arguments:
#     + doxygen_in: Doxygen template file.
#     + doc_dir: Document source directory to be copied from.
#     Reads following variable:
#     + PRJ_DOC_DIR: Directory for document
#
#
IF(NOT DEFINED _MANAGE_APIDOC_CMAKE_)
    SET(_MANAGE_APIDOC_CMAKE_ "DEFINED")
    INCLUDE(ManageMessage)

    MACRO(MANAGE_APIDOC_DOXYGEN doxygen_in doc_dir)
	SET(SOURCE_ARCHIVE_IGNORE_FILES ${SOURCE_ARCHIVE_IGNORE_FILES} "/Doxyfile$")
	SET(_manage_apidoc_doxygen_dependency_missing 0)
	IF(NOT PRJ_DOC_DIR)
	    M_MSG(${M_OFF} "PRJ_DOC_DIR undefined. Doxygen support disabled.")
	    SET(_manage_apidoc_doxygen_dependency_missing 1)
	ENDIF(NOT PRJ_DOC_DIR)

	FIND_PACKAGE(doxygen)
	IF(NOT PACKAGE_FOUND_NAME)
	    M_MSG(${M_OFF} "Package doxygen not found. Doxygen support disabled.")
	    SET(_manage_apidoc_doxygen_dependency_missing 1)
	ENDIF(NOT PACKAGE_FOUND_NAME)

	FIND_PROGRAM(DOXYGEN_CMD doxygen)
	IF(DOXYGEN_CMD STREQUAL "DOXYGEN_CMD-NOTFOUND")
	    M_MSG(${M_OFF} "Program doxygen not found. Doxygen support disabled.")
	    SET(_manage_apidoc_doxygen_dependency_missing 1)
	ENDIF(DOXYGEN_CMD STREQUAL "DOXYGEN_CMD-NOTFOUND")

	IF(NOT _manage_apidoc_doxygen_dependency_missing)
	    CONFIGURE_FILE(${doxygen_in} Doxyfile)

	    ADD_CUSTOM_TARGET(doxygen
		COMMAND "${DOXYGEN_CMD}" "Doxyfile"
		)

	    INSTALL(DIRECTORY ${doc_dir}
		DESTINATION "${PRJ_DOC_DIR}"
		)
	ENDIF(NOT _manage_apidoc_doxygen_dependency_missing)
    ENDMACRO(MANAGE_APIDOC_DOXYGEN doxygen_template)
ENDIF(NOT DEFINED _MANAGE_APIDOC_CMAKE_)