/usr/share/cmake/DoxygenBuilder/DoxygenBuilderConfig.cmake is in cmake-extras 1.3+17.04.20170310-1ubuntu4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | # Copyright (C) 2015 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This package provides macros that wrap the doxygen program.
#
# Example usage:
#
# find_package(DoxygenBuilder)
#
# add_doxygen(
# mydoc
# INPUT
# "${CMAKE_SOURCE_DIR}/src/some_part_of_source_tree"
# "${CMAKE_CURRENT_SOURCE_DIR}/pages"
# STRIP_FROM_PATH
# "${CMAKE_SOURCE_DIR}/src/some_part_of_source_tree"
# STRIP_FROM_INC_PATH
# "${CMAKE_SOURCE_DIR}/src/some_part_of_source_tree"
# EXCLUDE_PATTERNS
# */internal/*
# EXCLUDE_SYMBOLS
# *::internal*
# *::Priv
# ALL
# )
#
find_package(Doxygen)
if(DOXYGEN_FOUND)
find_file(DOXYFILE_IN "Doxyfile.in"
PATHS "${CMAKE_CURRENT_LIST_DIR}"
NO_DEFAULT_PATH
DOC "Path to the doxygen configuration template file")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(DOXYFILE_IN DEFAULT_MSG "DOXYFILE_IN")
endif()
# Build a space-separated string
function(_doxygen_to_space_string OUTPUT_NAME INPUT)
set(_TMP "")
foreach(ITEM ${INPUT})
set(_TMP "${_TMP} ${ITEM}")
endforeach()
set(${OUTPUT_NAME} "${_TMP}" PARENT_SCOPE)
endfunction()
# Build a space-separated, quoted string
function(_doxygen_to_quoted_string OUTPUT_NAME INPUT)
set(_TMP "")
foreach(ITEM ${INPUT})
set(_TMP "${_TMP} \"${ITEM}\"")
endforeach()
set(${OUTPUT_NAME} "${_TMP}" PARENT_SCOPE)
endfunction()
function(add_doxygen TARGET_NAME)
if(DOXYGEN_FOUND AND DOXYFILE_IN_FOUND)
set(_options ALL LATEX XML)
set(_oneValueArgs OUTPUT_DIRECTORY LATEX_OUTPUT HTML_OUTPUT XML_OUTPUT
DOXYFILE_IN IMAGE_PATH EXAMPLE_PATH STRIP_FROM_PATH STRIP_FROM_INC_PATH
PROJECT_NAME PROJECT_NUMBER INSTALL)
set(_multiValueArgs INPUT FILE_PATTERNS EXCLUDE EXCLUDE_PATTERNS
EXCLUDE_SYMBOLS)
cmake_parse_arguments(_ARG "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
set(INPUT "\"${CMAKE_CURRENT_SOURCE_DIR}\"")
if(_ARG_INPUT)
set(INPUT "${_ARG_INPUT}")
endif()
_doxygen_to_quoted_string(DOXYFILE_INPUT "${INPUT}")
set(DOXYFILE_FILE_PATTERNS "")
if(_ARG_FILE_PATTERNS)
_doxygen_to_space_string(DOXYFILE_FILE_PATTERNS "${_ARG_FILE_PATTERNS}")
endif()
set(DOXYFILE_EXCLUDE "")
if(_ARG_EXCLUDE)
_doxygen_to_quoted_string(DOXYFILE_EXCLUDE "${_ARG_EXCLUDE}")
endif()
set(DOXYFILE_EXCLUDE_PATTERNS "")
if(_ARG_EXCLUDE_PATTERNS)
_doxygen_to_space_string(DOXYFILE_EXCLUDE_PATTERNS "${_ARG_EXCLUDE_PATTERNS}")
endif()
set(DOXYFILE_EXCLUDE_SYMBOLS "")
if(_ARG_EXCLUDE_SYMBOLS)
_doxygen_to_space_string(DOXYFILE_EXCLUDE_SYMBOLS "${_ARG_EXCLUDE_SYMBOLS}")
endif()
set(DOXYFILE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
if(_ARG_OUTPUT_DIRECTORY)
set(DOXYFILE_OUTPUT_DIRECTORY "${_ARG_OUTPUT_DIRECTORY}")
endif()
set(DOXYFILE_HTML_OUTPUT "html")
if(_ARG_HTML_OUTPUT)
set(DOXYFILE_HTML_OUTPUT "${_ARG_HTML_OUTPUT}")
endif()
set(DOXYFILE_LATEX_OUTPUT "latex")
if(_ARG_LATEX_OUTPUT)
set(DOXYFILE_LATEX_OUTPUT "${_ARG_LATEX_OUTPUT}")
endif()
set(DOXYFILE_XML_OUTPUT "xml")
if(_ARG_XML_OUTPUT)
set(DOXYFILE_XML_OUTPUT "${_ARG_XML_OUTPUT}")
endif()
set(DOXYFILE_EXAMPLE_PATH "")
if(_ARG_EXAMPLE_PATH)
set(DOXYFILE_EXAMPLE_PATH "${_ARG_EXAMPLE_PATH}")
endif()
set(DOXYFILE_IMAGE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
if(_ARG_IMAGE_PATH)
set(DOXYFILE_IMAGE_PATH "${_ARG_IMAGE_PATH}")
endif()
set(_DOXYFILE_IN "${DOXYFILE_IN}")
if(_ARG_DOXYFILE_IN)
set(_DOXYFILE_IN "${_ARG_DOXYFILE_IN}")
endif()
set(DOXYFILE_STRIP_FROM_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
if(_ARG_STRIP_FROM_PATH)
set(DOXYFILE_STRIP_FROM_PATH "${_ARG_STRIP_FROM_PATH}")
endif()
set(DOXYFILE_STRIP_FROM_INC_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
if(_ARG_STRIP_FROM_INC_PATH)
set(DOXYFILE_STRIP_FROM_INC_PATH "${_ARG_STRIP_FROM_INC_PATH}")
endif()
set(DOXYFILE_PROJECT_NAME "${PROJECT_NAME}")
if(_ARG_PROJECT_NAME)
set(DOXYFILE_PROJECT_NAME "${_ARG_PROJECT_NAME}")
endif()
set(DOXYFILE_PROJECT_NUMBER "")
if(_ARG_PROJECT_NUMBER)
set(DOXYFILE_PROJECT_NUMBER "${_ARG_PROJECT_NUMBER}")
endif()
set(DOXYFILE_GENERATE_LATEX "OFF")
if(_ARG_LATEX)
set(DOXYFILE_GENERATE_LATEX "ON")
if(_ARG_INSTALL)
install(
DIRECTORY
"${DOXYFILE_OUTPUT_DIRECTORY}/${DOXYFILE_LATEX_OUTPUT}"
DESTINATION
"${_ARG_INSTALL}"
)
endif()
set_property(
DIRECTORY
APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES
"${DOXYFILE_OUTPUT_DIRECTORY}/${DOXYFILE_LATEX_OUTPUT}"
)
endif()
set(DOXYFILE_GENERATE_XML "NO")
if(_ARG_XML)
set(DOXYFILE_GENERATE_XML "YES")
if(_ARG_INSTALL)
install(
DIRECTORY
"${DOXYFILE_OUTPUT_DIRECTORY}/${DOXYFILE_XML_OUTPUT}"
DESTINATION
"${_ARG_INSTALL}"
)
endif()
set_property(
DIRECTORY
APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES
"${DOXYFILE_OUTPUT_DIRECTORY}/${DOXYFILE_XML_OUTPUT}"
)
endif()
if (_ARG_ALL)
set(_ALL "ALL")
endif()
set(_DOXYFILE "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile")
set_property(
DIRECTORY
APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES
"${DOXYFILE_OUTPUT_DIRECTORY}/${DOXYFILE_HTML_OUTPUT}"
)
set(DOXYFILE_HAVE_DOT "NO")
if(DOXYGEN_DOT_EXECUTABLE)
set(DOXYFILE_HAVE_DOT "YES")
endif()
set(DOXYFILE_USE_PDFLATEX "NO")
if(DOXYFILE_LATEX STREQUAL "ON")
find_package(LATEX)
find_program(DOXYFILE_MAKE make)
mark_as_advanced(DOXYFILE_MAKE)
if(LATEX_COMPILER AND MAKEINDEX_COMPILER AND DOXYFILE_MAKE)
set(DOXYFILE_GENERATE_LATEX "YES")
if(PDFLATEX_COMPILER)
set(DOXYFILE_USE_PDFLATEX "YES")
endif()
add_custom_command(
TARGET
${TARGET_NAME}
POST_BUILD
COMMAND
"${DOXYFILE_MAKE}"
COMMENT
"Running LaTeX for Doxygen documentation in ${DOXYFILE_OUTPUT_DIRECTORY}/${DOXYFILE_LATEX_OUTPUT}..."
WORKING_DIRECTORY
"${DOXYFILE_OUTPUT_DIR}/${DOXYFILE_LATEX_OUTPUT}"
)
else()
set(DOXYFILE_GENERATE_LATEX "NO")
endif()
else()
set(DOXYFILE_GENERATE_LATEX "NO")
endif()
configure_file("${_DOXYFILE_IN}" "${_DOXYFILE}" @ONLY)
set(OUTPUT_FILE "${DOXYFILE_OUTPUT_DIRECTORY}/${DOXYFILE_HTML_OUTPUT}/index.html")
set(DEPENDENCIES "")
foreach(_DIRECTORY ${INPUT})
file(
GLOB_RECURSE _TMP
"${_DIRECTORY}/*"
)
list(APPEND DEPENDENCIES ${_TMP})
endforeach()
add_custom_command(
OUTPUT
"${OUTPUT_FILE}"
COMMAND
"${DOXYGEN_EXECUTABLE}"
"${_DOXYFILE}"
DEPENDS
"${_DOXYFILE}"
${DEPENDENCIES}
COMMENT
"Writing documentation to ${DOXYFILE_OUTPUT_DIRECTORY}..."
WORKING_DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}"
)
add_custom_target(
${TARGET_NAME}
${_ALL}
DEPENDS
"${OUTPUT_FILE}"
)
if(_ARG_INSTALL)
install(
DIRECTORY
"${DOXYFILE_OUTPUT_DIRECTORY}/${DOXYFILE_HTML_OUTPUT}"
DESTINATION
"${_ARG_INSTALL}"
)
endif()
endif()
endfunction()
|